mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user