CalcTargetMovementOffset: better integer calculation for max tiles penalty.

SOLDIERTYPE::initialize: initialize additional data.
EVENT_FireSoldierWeapon: if shooting soldier is invisible, locate screen to target spot.
CancelAIAction: reset next AI action.
FindBestPath: improved gas avoiding code.
InGas: improved code, also check the spot itself.
LegalNPCDestination: disabled additional checks to prevent AI deadlock.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8695 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2019-10-03 16:49:04 +00:00
parent 54e7c1e24d
commit 30df6c350a
7 changed files with 83 additions and 29 deletions
+4 -3
View File
@@ -62,6 +62,7 @@ extern UINT16 gubAnimSurfaceIndex[ TOTALBODYTYPES ][ NUMANIMATIONSTATES ];
// sevenfm:
extern BOOLEAN InGas( SOLDIERTYPE *pSoldier, INT32 sGridNo );
extern BOOLEAN InGasSpot(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel);
//extern UINT8 gubDiagCost[20];
// skiplist has extra level of pointers every 4 elements, so a level 5is optimized for
@@ -3144,9 +3145,9 @@ if(!GridNoOnVisibleWorldTile(iDestination))
}
// sevenfm: skip gas if not in gas already
if( !(s->flags.uiStatusFlags & SOLDIER_PC) &&
InGas(s, newLoc) &&
!InGas(s, s->sGridNo) )
if (!(s->flags.uiStatusFlags & SOLDIER_PC) &&
InGasSpot(s, newLoc, ubLevel) &&
!InGasSpot(s, s->sGridNo, ubLevel))
{
goto NEXTDIR;
}