Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5025,6 +5025,8 @@ StateReturnType AIAttackFireWeaponState::onEnter()

Object *obj = getMachineOwner();
AIUpdateInterface *ai = obj->getAI();
if (!ai)
return STATE_FAILURE;

// Passive stuff will approach but not attack, so we check here (after approach is complete)
UnsignedInt adjust = ai->getMoodMatrixActionAdjustment(MM_Action_Attack);
Expand Down Expand Up @@ -5314,6 +5316,8 @@ StateReturnType AIAttackState::onEnter()
//CRCDEBUG_LOG(("AIAttackState::onEnter() - start for object %d", getMachineOwner()->getID()));
Object* source = getMachineOwner();
AIUpdateInterface *ai = source->getAI();
if (!ai)
return STATE_FAILURE;
// if we are in sleep mode, we will not attack
if ((ai->getMoodMatrixActionAdjustment(MM_Action_Attack) & MAA_Action_Ok) == 0)
return STATE_SUCCESS;
Expand Down
4 changes: 4 additions & 0 deletions GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5180,6 +5180,8 @@ StateReturnType AIAttackFireWeaponState::onEnter()

Object *obj = getMachineOwner();
AIUpdateInterface *ai = obj->getAI();
if (!ai)
return STATE_FAILURE;

// Passive stuff will approach but not attack, so we check here (after approach is complete)
UnsignedInt adjust = ai->getMoodMatrixActionAdjustment(MM_Action_Attack);
Expand Down Expand Up @@ -5512,6 +5514,8 @@ StateReturnType AIAttackState::onEnter()
//CRCDEBUG_LOG(("AIAttackState::onEnter() - start for object %d", getMachineOwner()->getID()));
Object* source = getMachineOwner();
AIUpdateInterface *ai = source->getAI();
if (!ai)
return STATE_FAILURE;
// if we are in sleep mode, we will not attack
if ((ai->getMoodMatrixActionAdjustment(MM_Action_Attack) & MAA_Action_Ok) == 0)
return STATE_SUCCESS;
Expand Down
Loading