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
+5 -5
View File
@@ -66,10 +66,10 @@ int LegalNPCDestination(SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 ubPathMode,
// AND the gridno hasn't been black-listed for us
// Nov 28 98: skip people in destination tile if in turnbased
// sevenfm: also check for bomb nearby
// sevenfm: disabled additional checks to prevent AI deadlock
if ( NewOKDestination(pSoldier, sGridNo, fSkipTilesWithMercs, pSoldier->pathing.bLevel ) &&
!InGas( pSoldier, sGridNo ) &&
!FindBombNearby(pSoldier, sGridNo, DAY_VISION_RANGE/8 ) &&
//!InGas( pSoldier, sGridNo ) &&
//!FindBombNearby(pSoldier, sGridNo, DAY_VISION_RANGE/8 ) &&
sGridNo != pSoldier->sGridNo &&
sGridNo != pSoldier->pathing.sBlackList )
{
@@ -78,7 +78,7 @@ int LegalNPCDestination(SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 ubPathMode,
return(FALSE);
//Madd: added to prevent people from running into gas and fire
if ( (gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->pathing.bLevel] & (MAPELEMENT_EXT_TEARGAS | MAPELEMENT_EXT_MUSTARDGAS)) &&
/*if ( (gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->pathing.bLevel] & (MAPELEMENT_EXT_TEARGAS | MAPELEMENT_EXT_MUSTARDGAS)) &&
!DoesSoldierWearGasMask( pSoldier ) )
{
return( FALSE );
@@ -87,7 +87,7 @@ int LegalNPCDestination(SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 ubPathMode,
if ( gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->pathing.bLevel] & MAPELEMENT_EXT_BURNABLEGAS )
{
return( FALSE );
}
}*/
// passed all checks, now try to make sure we can get there!
switch (ubPathMode)