Index: binaries/data/mods/public/simulation/components/EndGameManager.js
===================================================================
--- binaries/data/mods/public/simulation/components/EndGameManager.js	(revision 14076)
+++ binaries/data/mods/public/simulation/components/EndGameManager.js	(working copy)
@@ -31,103 +31,50 @@
 	this.alliedVictory = flag;
 };
 
-/**
- * Begin checking the end-game conditions.
- * Must be called once, after calling SetGameType.
- */
-EndGameManager.prototype.Start = function()
+EndGameManager.prototype.PlayerLostAllConquestCriticalEntities = function(playerID)
 {
-	if (this.gameType != "endless")
-	{
-		var cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer);
-		this.timer = cmpTimer.SetTimeout(this.entity, IID_EndGameManager, "ProgressTimeout", g_ProgressInterval, {});
-	}
-};
+	if (this.gameType == "endless")
+		return; 
 
-EndGameManager.prototype.OnDestroy = function()
-{
-	if (this.timer)
-	{
-		var cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer);
-		cmpTimer.CancelTimer(this.timer);
-	}
-};
-
-EndGameManager.prototype.ProgressTimeout = function(data)
-{
-	this.UpdatePlayerStates();
+	// for all other game types, defeat that player
+	var cmpPlayerManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager);
 	
-	// Repeat the timer
-	var cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer);
-	this.timer = cmpTimer.SetTimeout(this.entity, IID_EndGameManager, "ProgressTimeout", g_ProgressInterval, data);
-};
-
-EndGameManager.prototype.UpdatePlayerStates = function()
-{
-	var cmpPlayerManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager);
-	switch (this.gameType)
+	// Ignore gaia
+	var numPlayers = cmpPlayerManager.GetNumPlayers() - 1;
+	var cmpPlayers = [];
+	
+	var allies = [];
+	var onlyAlliesLeft = true;
+	// If the player is currently active but needs to be defeated,
+	// mark that player as defeated
+	// cache the cmpPlayer instances of the other players and search the allies
+	for (var i = 0; i < numPlayers; i++)
 	{
-	case "conquest":
-
-		// Ignore gaia
-		var numPlayers = cmpPlayerManager.GetNumPlayers() - 1;
-		var cmpPlayers = new Array(numPlayers);
-		
-		// If a player is currently active but has no suitable units left,
-		// mark that player as defeated
-		for (var i = 0; i < numPlayers; i++)
+		var playerEntityId = cmpPlayerManager.GetPlayerByID(i+1);
+		cmpPlayers[i] = Engine.QueryInterface(playerEntityId, IID_Player);
+		if (cmpPlayers[i].GetState() != "active") // cmpPlayer should always exist
+			continue;
+		if (cmpPlayers[i].GetPlayerID() == playerID)
+			Engine.PostMessage(playerEntityId, MT_PlayerDefeated, { "playerId": i } );
+		else
 		{
-			var playerEntityId = cmpPlayerManager.GetPlayerByID(i+1);
-			cmpPlayers[i] = Engine.QueryInterface(playerEntityId, IID_Player);
-			if (cmpPlayers[i].GetState() == "active")
-			{
-				if (cmpPlayers[i].GetConquestCriticalEntitiesCount() == 0)
-				{	// Defeated - notify AIs by sending playerId
-					Engine.PostMessage(playerEntityId, MT_PlayerDefeated, { "playerId": i } );
-				}
-			}
+			if (!allies.length || cmpPlayers[allies[0]].IsMutualAlly(i+1))
+				allies.push(i);
+			else
+				onlyAlliesLeft = false;
 		}
+	}
 
-		var onlyAlliesLeft = true;
-		var allies = [];
-		for (var i = 0; i < numPlayers && onlyAlliesLeft; i++)
-		{
-			if (cmpPlayers[i].GetState() == "active")
-			{	//Active player
-				for (var j = 0; j < numPlayers && onlyAlliesLeft; j++)
-				{
-					if (cmpPlayers[j].GetState() == "active"
-						&& (cmpPlayers[i].IsEnemy(j+1) || cmpPlayers[j].IsEnemy(i+1)
-						    || cmpPlayers[i].IsNeutral(j+1) || cmpPlayers[j].IsNeutral(i+1)))
-					{	// Only need to find an active non-allied player
-						onlyAlliesLeft = false;
-					}
-				}
-				
-				if (onlyAlliesLeft)
-					allies.push(i);
-			}
-		}
+	// check if there are winners, or the game needs to continue
+	if (!allies.length || !onlyAlliesLeft || !(this.alliedVictory || allies.length == 1))
+		return; 
 
-		// If only allies left and allied victory set (or only one player left)
-		if (onlyAlliesLeft && (this.alliedVictory || allies.length == 1))
-		{
-			for each (var p in allies)
-			{
-				cmpPlayers[p].SetState("won");
-			}
+	for each (var p in allies)
+		cmpPlayers[p].SetState("won");
 
-			// Reveal the map to all players
-			var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
-			cmpRangeManager.SetLosRevealAll(-1, true);
-		}
-
-		break;
-
-	default:
-		error("Invalid game type "+this.gameType);
-		break;
-	}
+	// Reveal the map to all players
+	var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
+	cmpRangeManager.SetLosRevealAll(-1, true);
 };
 
 Engine.RegisterComponentType(IID_EndGameManager, "EndGameManager", EndGameManager);
Index: binaries/data/mods/public/simulation/components/Player.js
===================================================================
--- binaries/data/mods/public/simulation/components/Player.js	(revision 14076)
+++ binaries/data/mods/public/simulation/components/Player.js	(working copy)
@@ -482,6 +482,13 @@
 		if (cmpIdentity && cmpIdentity.HasClass("ConquestCritical"))
 			this.conquestCriticalEntitiesCount--;
 
+		if (this.conquestCriticalEntitiesCount == 0)
+		{
+			// end game when needed
+			var cmpEndGameManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_EndGameManager);
+			cmpEndGameManager.PlayerLostAllConquestCriticalEntities(this.playerID);
+		}
+
 		if (cmpCost)
 		{
 			this.popUsed -= cmpCost.GetPopCost();
Index: binaries/data/mods/public/simulation/helpers/Setup.js
===================================================================
--- binaries/data/mods/public/simulation/helpers/Setup.js	(revision 14076)
+++ binaries/data/mods/public/simulation/helpers/Setup.js	(working copy)
@@ -38,10 +38,7 @@
 
 	var cmpEndGameManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_EndGameManager);
 	if (settings.GameType)
-	{
 		cmpEndGameManager.SetGameType(settings.GameType);
-	}
-	cmpEndGameManager.Start();
 }
 
 Engine.RegisterGlobal("LoadMapSettings", LoadMapSettings);
