mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
Improve readability
This commit is contained in:
@@ -18480,16 +18480,18 @@ INT8 DecideActionRedSoldier(SOLDIERTYPE* pSoldier)
|
|||||||
if (BestThrow.ubPossible)
|
if (BestThrow.ubPossible)
|
||||||
{
|
{
|
||||||
DebugAI(AI_MSG_INFO, pSoldier, String("throw possible"), gLogDecideActionRed);
|
DebugAI(AI_MSG_INFO, pSoldier, String("throw possible"), gLogDecideActionRed);
|
||||||
|
|
||||||
|
const auto item = pSoldier->inv[BestThrow.bWeaponIn].usItem;
|
||||||
|
|
||||||
// sevenfm: allow using mortars, grenade launchers, flares and grenades in RED state
|
// sevenfm: allow using mortars, grenade launchers, flares and grenades in RED state
|
||||||
if (ItemIsMortar(pSoldier->inv[BestThrow.bWeaponIn].usItem) ||
|
if (ItemIsMortar(item) ||
|
||||||
//Item[pSoldier->inv[ BestThrow.bWeaponIn ].usItem].cannon ||
|
ItemIsRocketLauncher(item) ||
|
||||||
ItemIsRocketLauncher(pSoldier->inv[BestThrow.bWeaponIn].usItem) ||
|
ItemIsGrenadeLauncher(item) ||
|
||||||
ItemIsGrenadeLauncher(pSoldier->inv[BestThrow.bWeaponIn].usItem) ||
|
ItemIsFlare(item) ||
|
||||||
ItemIsFlare(pSoldier->inv[BestThrow.bWeaponIn].usItem) ||
|
Item[item].usItemClass & IC_GRENADE)
|
||||||
Item[pSoldier->inv[BestThrow.bWeaponIn].usItem].usItemClass & IC_GRENADE)
|
|
||||||
{
|
{
|
||||||
// if firing mortar make sure we have room
|
// if firing mortar make sure we have room
|
||||||
if (ItemIsMortar(pSoldier->inv[BestThrow.bWeaponIn].usItem))
|
if (ItemIsMortar(item))
|
||||||
{
|
{
|
||||||
DebugAI(AI_MSG_INFO, pSoldier, String("using mortar, check room to deploy"), gLogDecideActionRed);
|
DebugAI(AI_MSG_INFO, pSoldier, String("using mortar, check room to deploy"), gLogDecideActionRed);
|
||||||
ubOpponentDir = AIDirection(pSoldier->sGridNo, BestThrow.sTarget);
|
ubOpponentDir = AIDirection(pSoldier->sGridNo, BestThrow.sTarget);
|
||||||
|
|||||||
Reference in New Issue
Block a user