Index: binaries/data/mods/public/simulation/components/Upgrade.js
===================================================================
--- binaries/data/mods/public/simulation/components/Upgrade.js	(révision 18785)
+++ binaries/data/mods/public/simulation/components/Upgrade.js	(copie de travail)
@@ -53,10 +53,11 @@ Upgrade.prototype.Schema =
 	"</oneOrMore>";
 
 Upgrade.prototype.Init = function()
 {
 	this.upgrading = false;
+	this.completed = false;
 	this.elapsedTime = 0;
 	this.timer = undefined;
 
 	this.upgradeTemplates = {};
 
@@ -73,20 +74,21 @@ Upgrade.prototype.Init = function()
 };
 
 // This will also deal with the "OnDestroy" case.
 Upgrade.prototype.OnOwnershipChanged = function(msg)
 {
-	this.CancelUpgrade(msg.from);
+	if (!this.completed)
+		this.CancelUpgrade(msg.from);
 	if (msg.to !== -1)
 		this.owner = msg.to;
 };
 
 Upgrade.prototype.ChangeUpgradedEntityCount = function(amount)
 {
 	if (!this.IsUpgrading())
 		return;
-	
+
 	let cmpTempMan = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager);
 	let template = cmpTempMan.GetTemplate(this.upgrading);
 
 	let category;
 	if (template.TrainingRestrictions)
@@ -295,10 +297,12 @@ Upgrade.prototype.UpgradeProgress = func
 		return;
 	}
 
 	this.CancelTimer();
 
+	this.completed = true;
+
 	let newEntity = ChangeEntityTemplate(this.entity, this.upgrading);
 
 	if (newEntity)
 		PlaySound("upgraded", newEntity);
 };
Index: libraries/source/spidermonkey/lib/mozjs31-ps-debug.lib
===================================================================
Impossible d'afficher : fichier considéré comme binaire.
svn:mime-type = application/octet-stream
Index: libraries/source/spidermonkey/lib/mozjs31-ps-debug.lib
===================================================================
--- libraries/source/spidermonkey/lib/mozjs31-ps-debug.lib	(révision 18785)
+++ libraries/source/spidermonkey/lib/mozjs31-ps-debug.lib	(nonexistent)

Modification de propriétés sur libraries/source/spidermonkey/lib/mozjs31-ps-debug.lib
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: libraries/source/spidermonkey/lib/mozjs31-ps-release.lib
===================================================================
Impossible d'afficher : fichier considéré comme binaire.
svn:mime-type = application/octet-stream
Index: libraries/source/spidermonkey/lib/mozjs31-ps-release.lib
===================================================================
--- libraries/source/spidermonkey/lib/mozjs31-ps-release.lib	(révision 18785)
+++ libraries/source/spidermonkey/lib/mozjs31-ps-release.lib	(nonexistent)

Modification de propriétés sur libraries/source/spidermonkey/lib/mozjs31-ps-release.lib
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: libraries/source/spidermonkey/lib/mozjs38-ps-debug.lib
===================================================================
Impossible d'afficher : fichier considéré comme binaire.
svn:mime-type = application/octet-stream
Index: libraries/source/spidermonkey/lib/mozjs38-ps-debug.lib
===================================================================
--- libraries/source/spidermonkey/lib/mozjs38-ps-debug.lib	(révision 18785)
+++ libraries/source/spidermonkey/lib/mozjs38-ps-debug.lib	(nonexistent)

Modification de propriétés sur libraries/source/spidermonkey/lib/mozjs38-ps-debug.lib
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: libraries/source/spidermonkey/lib/mozjs38-ps-release.lib
===================================================================
Impossible d'afficher : fichier considéré comme binaire.
svn:mime-type = application/octet-stream
Index: libraries/source/spidermonkey/lib/mozjs38-ps-release.lib
===================================================================
--- libraries/source/spidermonkey/lib/mozjs38-ps-release.lib	(révision 18785)
+++ libraries/source/spidermonkey/lib/mozjs38-ps-release.lib	(nonexistent)

Modification de propriétés sur libraries/source/spidermonkey/lib/mozjs38-ps-release.lib
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
