mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Moved armed vehicle/robot in gas check into function
Originally placed in DecideAction(green/yellow/red/black) functions separately
This commit is contained in:
@@ -2253,6 +2253,12 @@ BOOLEAN InWaterGasOrSmoke( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||
|
||||
BOOLEAN InGasOrSmoke( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||
{
|
||||
// Armed vehicles and robots do not care about gas or smoke
|
||||
if (ARMED_VEHICLE(pSoldier) || ENEMYROBOT(pSoldier))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// smoke
|
||||
if ( gpWorldLevelData[sGridNo].ubExtFlags[pSoldier->pathing.bLevel] & (MAPELEMENT_EXT_SMOKE | MAPELEMENT_EXT_SIGNAL_SMOKE | MAPELEMENT_EXT_DEBRIS_SMOKE | MAPELEMENT_EXT_FIRERETARDANT_SMOKE ) )
|
||||
return TRUE;
|
||||
@@ -2300,6 +2306,12 @@ BOOLEAN InGas(SOLDIERTYPE *pSoldier, INT32 sGridNo)
|
||||
if (TileIsOutOfBounds(sGridNo))
|
||||
return FALSE;
|
||||
|
||||
// Armed vehicles and robots do not care about gas or smoke
|
||||
if (ARMED_VEHICLE(pSoldier) || ENEMYROBOT(pSoldier))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (InGasSpot(pSoldier, sGridNo, pSoldier->pathing.bLevel))
|
||||
{
|
||||
return TRUE;
|
||||
|
||||
@@ -807,12 +807,6 @@ INT8 DecideActionGreen(SOLDIERTYPE *pSoldier)
|
||||
// check if standing in tear gas without a gas mask on, or in smoke
|
||||
bInGas = InGasOrSmoke( pSoldier, pSoldier->sGridNo );
|
||||
|
||||
// Flugente: tanks do not care about gas
|
||||
if ( ARMED_VEHICLE( pSoldier ) || ENEMYROBOT( pSoldier ) )
|
||||
{
|
||||
bInGas = FALSE;
|
||||
}
|
||||
|
||||
// if real-time, and not in the way, do nothing 90% of the time (for GUARDS!)
|
||||
// unless in water (could've started there), then we better swim to shore!
|
||||
|
||||
@@ -2589,12 +2583,6 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier)
|
||||
// check if standing in tear gas without a gas mask on
|
||||
bInGas = InGasOrSmoke( pSoldier, pSoldier->sGridNo );
|
||||
|
||||
// Flugente: tanks do not care about gas
|
||||
if ( ARMED_VEHICLE( pSoldier ) || ENEMYROBOT( pSoldier ) )
|
||||
{
|
||||
bInGas = FALSE;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// WHEN LEFT IN GAS, WEAR GAS MASK IF AVAILABLE AND NOT WORN
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
@@ -5042,12 +5030,6 @@ INT16 ubMinAPCost;
|
||||
// check if standing in tear gas without a gas mask on
|
||||
bInGas = InGasOrSmoke( pSoldier, pSoldier->sGridNo );
|
||||
|
||||
// Flugente: tanks do not care about gas
|
||||
if ( ARMED_VEHICLE( pSoldier ) || ENEMYROBOT( pSoldier ) )
|
||||
{
|
||||
bInGas = FALSE;
|
||||
}
|
||||
|
||||
// calculate our morale
|
||||
pSoldier->aiData.bAIMorale = CalcMorale(pSoldier);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user