HomeWildfire Games

Fix AI tasking catafalques to the center of the CC.

Description

Fix AI tasking catafalques to the center of the CC.

There is some unit-motion/unitAI bug that makes them not reach the center and hence idleness.

Refs. #6735 by fixing the specific PetraAI <> catafalque case.
Reported and solution by: @Langbart

Event Timeline

note: the gameState.getEntityById(... was superfluous ... works also without it. 😶

--- a/binaries/data/mods/public/simulation/ai/petra/victoryManager.js
+++ b/binaries/data/mods/public/simulation/ai/petra/victoryManager.js
@@ -473,9 +473,8 @@ PETRA.VictoryManager.prototype.pickCriticalEntRetreatLocation = function(gameSta
 	let bestBase = PETRA.getBestBase(gameState, criticalEnt, true);
 	if (bestBase.accessIndex == accessIndex)
 	{
-		const bestBasePos = bestBase.anchor.position();
-		criticalEnt.moveToRange(bestBasePos[0], bestBasePos[1],
-			0, gameState.getEntityById(bestBase.anchorId).obstructionRadius().max);
+		const [posx, posz] = bestBase.anchor.position();
+		criticalEnt.moveToRange(posx, posz, 0, bestBase.anchor.obstructionRadius().max);
 	}
 };