From 9c563c9c8ae36a476ae0d8b08c8948911b4ec57b Mon Sep 17 00:00:00 2001 From: Sevenfm Date: Sun, 12 Jan 2020 09:17:51 +0000 Subject: [PATCH] Improved AI path tweaks. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8730 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/PATHAI.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Tactical/PATHAI.cpp b/Tactical/PATHAI.cpp index cd539121e..82a18d0a2 100644 --- a/Tactical/PATHAI.cpp +++ b/Tactical/PATHAI.cpp @@ -3842,14 +3842,17 @@ if(!GridNoOnVisibleWorldTile(iDestination)) newTotCost = curCost + nextCost; - // sevenfm: experimental path AI tweaks + // sevenfm: experimental path tweaks for AI if (s->bTeam != gbPlayerNum && !(s->flags.uiStatusFlags & SOLDIER_BOXER) && !AreInMeanwhile() && IS_MERC_BODY_TYPE(s)) { - if (InGasSpot(s, newLoc, bLevel) || - DeepWater(newLoc, bLevel) && (s->numFlanks == 0 || s->numFlanks >= MAX_FLANKS_RED)) + if (InGasSpot(s, newLoc, bLevel)) + { + nextCost += 40; + } + else if (DeepWater(newLoc, bLevel) && (s->numFlanks == 0 || s->numFlanks >= MAX_FLANKS_RED)) { nextCost += 20; }