Attempt to continue moving towards enemy

when in water. If our current or last action was AI_ACTION_SEEK_OPPONENT.

The AI tends to flipflop between jumping into water, swimming a certain distance and then "panic" because they're in the water and then try to reach the closest land tile. Which is often right where they entered the water. Adding a bit of decision momentum with this change should help with that.
This commit is contained in:
Asdow
2024-02-10 18:35:25 +02:00
parent 4faccb2957
commit 3c2b048367
+1 -1
View File
@@ -10599,7 +10599,7 @@ ActionType DecideActionStuckInWaterOrGas(SOLDIERTYPE *pSoldier, BOOLEAN ubCanMov
DebugAI(AI_MSG_TOPIC, pSoldier, String("[Decide action if stuck in water or gas]"));
// when in deep water, move to closest opponent
if (ubCanMove && (bInDeepWater || bInWater) && !pSoldier->aiData.bNeutral && pSoldier->aiData.bOrders == SEEKENEMY)
if (ubCanMove && (bInDeepWater || bInWater) && !pSoldier->aiData.bNeutral && (pSoldier->aiData.bOrders == SEEKENEMY || pSoldier->aiData.bAction == AI_ACTION_SEEK_OPPONENT || pSoldier->aiData.bLastAction == AI_ACTION_SEEK_OPPONENT))
{
// find closest reachable opponent, excluding opponents in deep water
BOOLEAN fClimbDummy;