mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
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:
+12
-6
@@ -1913,8 +1913,10 @@ INT16 EstimatePathCostToLocation( SOLDIERTYPE * pSoldier, INT32 sDestGridNo, INT
|
||||
{
|
||||
// on ground or same building... normal!
|
||||
sPathCost = EstimatePlotPath( pSoldier, sDestGridNo, FALSE, FALSE, FALSE, WALKING, FALSE, FALSE, 0);
|
||||
*pfClimbingNecessary = FALSE;
|
||||
*psClimbGridNo = NOWHERE;
|
||||
if (pfClimbingNecessary)
|
||||
*pfClimbingNecessary = FALSE;
|
||||
if (psClimbGridNo)
|
||||
*psClimbGridNo = NOWHERE;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1945,8 +1947,10 @@ INT16 EstimatePathCostToLocation( SOLDIERTYPE * pSoldier, INT32 sDestGridNo, INT
|
||||
// add in an estimate of getting there after climbing down, *but not on top of roof*
|
||||
sPathCost += (APBPConstants[AP_MOVEMENT_FLAT] + APBPConstants[AP_MODIFIER_WALK]) * PythSpacesAway( sClimbGridNo, sDestGridNo ) / 2;
|
||||
}
|
||||
*pfClimbingNecessary = TRUE;
|
||||
*psClimbGridNo = sClimbGridNo;
|
||||
if (pfClimbingNecessary)
|
||||
*pfClimbingNecessary = TRUE;
|
||||
if (psClimbGridNo)
|
||||
*psClimbGridNo = sClimbGridNo;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2001,8 +2005,10 @@ INT16 EstimatePathCostToLocation( SOLDIERTYPE * pSoldier, INT32 sDestGridNo, INT
|
||||
// estimate walk cost
|
||||
sPathCost += (APBPConstants[AP_MOVEMENT_FLAT] + APBPConstants[AP_MODIFIER_WALK]) * PythSpacesAway( sClimbGridNo, sDestGridNo );
|
||||
}
|
||||
*pfClimbingNecessary = TRUE;
|
||||
*psClimbGridNo = sClimbGridNo;
|
||||
if (pfClimbingNecessary)
|
||||
*pfClimbingNecessary = TRUE;
|
||||
if (psClimbGridNo)
|
||||
*psClimbGridNo = sClimbGridNo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user