mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Migrate features from +AI
Possibly wear gasmask if soldier sees tear or mustard gas
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
//#pragma optimize("", off)
|
||||
#include "ai.h"
|
||||
#include "AIInternals.h"
|
||||
#include "Isometric Utils.h"
|
||||
@@ -10730,6 +10731,19 @@ INT8 DecideActionWearGasmask(SOLDIERTYPE *pSoldier)
|
||||
//Only put mask on in gas
|
||||
if (bInGas && WearGasMaskIfAvailable(pSoldier)) { bInGas = InGasOrSmoke(pSoldier, pSoldier->sGridNo); }
|
||||
|
||||
// Chance to wear gas mask if soldier sees gas nearby
|
||||
INT32 sSmokeSpot = NOWHERE;
|
||||
INT8 bSmokeLevel = 0;
|
||||
|
||||
if ( SoldierAI(pSoldier) &&
|
||||
pSoldier->CheckInitialAP() &&
|
||||
!DoesSoldierWearGasMask(pSoldier) &&
|
||||
FindClosestVisibleSmoke(pSoldier, sSmokeSpot, bSmokeLevel, TRUE) &&
|
||||
Chance(30 + SoldierDifficultyLevel(pSoldier) * 10) )
|
||||
{
|
||||
WearGasMaskIfAvailable(pSoldier);
|
||||
}
|
||||
|
||||
return bInGas;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user