EstimatePathCostToLocation: safety checks.

Main Red AI: fixed decision weight calculation.
Player mercs should avoid moving into gas/fire when in autobandage mode or under AI control.
IsLocationSittable, IsLocationSittableExcludingPeople: return FALSE if location on roof does not exist.
NWSS: play room effect for first shot only.
AI inventory choosing: more variety for mortar shells, improved hand/GL grenade choosing code.
Red AI: improved mortar use code: use next action to fire mortar after stepping back.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8920 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2021-01-14 15:45:11 +00:00
parent c6c0b09b70
commit 32e8f9d4ff
6 changed files with 85 additions and 48 deletions
+12 -4
View File
@@ -5343,12 +5343,17 @@ BOOLEAN IsLocationSittable( INT32 iMapIndex, BOOLEAN fOnRoof )
{
STRUCTURE *pStructure;
INT16 sDesiredLevel;
if( WhoIsThere2( iMapIndex, 0 ) != NOBODY )
return FALSE;
//Locations on roofs without a roof is not possible, so
//we convert the onroof intention to ground.
if( fOnRoof && !FlatRoofAboveGridNo( iMapIndex ) )
fOnRoof = FALSE;
// sevenfm: return FALSE if location on roof does not exist
if (fOnRoof && !FlatRoofAboveGridNo(iMapIndex))
return FALSE;
//fOnRoof = FALSE;
// Check structure database
if( gpWorldLevelData[ iMapIndex ].pStructureHead )
{
@@ -5373,8 +5378,11 @@ BOOLEAN IsLocationSittableExcludingPeople( INT32 iMapIndex, BOOLEAN fOnRoof )
//Locations on roofs without a roof is not possible, so
//we convert the onroof intention to ground.
if( fOnRoof && !FlatRoofAboveGridNo( iMapIndex ) )
fOnRoof = FALSE;
// sevenfm: return FALSE if location on roof does not exist
if (fOnRoof && !FlatRoofAboveGridNo(iMapIndex))
return FALSE;
//fOnRoof = FALSE;
// Check structure database
if( gpWorldLevelData[ iMapIndex ].pStructureHead )
{