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
8 changes: 8 additions & 0 deletions Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2596,7 +2596,15 @@ StateReturnType AIAttackApproachTargetState::updateInternal()
{
if( victim->testStatus( OBJECT_STATUS_STEALTHED ) && !victim->testStatus( OBJECT_STATUS_DETECTED ) )
{
#if RETAIL_COMPATIBLE_CRC
return STATE_FAILURE; // If obj is stealthed, can no longer approach.
#else
Bool isTargetingMine = weapon && weapon->getDamageType() == DAMAGE_DISARM &&
(victim->isKindOf(KINDOF_MINE));

if (!isTargetingMine)
return STATE_FAILURE; // If obj is stealthed, can no longer approach - unless we're targeting a mine!
#endif
}
ai->setCurrentVictim(victim);
// Attacking an object.
Expand Down
8 changes: 8 additions & 0 deletions GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2682,7 +2682,15 @@ StateReturnType AIAttackApproachTargetState::updateInternal()
}
if( victim->testStatus( OBJECT_STATUS_STEALTHED ) && !victim->testStatus( OBJECT_STATUS_DETECTED ) && !victim->testStatus( OBJECT_STATUS_DISGUISED ) )
{
#if RETAIL_COMPATIBLE_CRC
return STATE_FAILURE; // If obj is stealthed, can no longer approach.
#else
Bool isTargetingMine = weapon && weapon->getDamageType() == DAMAGE_DISARM &&
(victim->isKindOf(KINDOF_MINE) || victim->isKindOf(KINDOF_BOOBY_TRAP) || victim->isKindOf(KINDOF_DEMOTRAP));

if (!isTargetingMine)
return STATE_FAILURE; // If obj is stealthed, can no longer approach - unless we're targeting a mine!
#endif
}
ai->setCurrentVictim(victim);
// Attacking an object.
Expand Down
Loading