File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
GeneralsMD/Code/GameEngine/Source/GameLogic/AI
Generals/Code/GameEngine/Source/GameLogic/AI Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -2596,7 +2596,15 @@ StateReturnType AIAttackApproachTargetState::updateInternal()
25962596 {
25972597 if ( victim->testStatus ( OBJECT_STATUS_STEALTHED ) && !victim->testStatus ( OBJECT_STATUS_DETECTED ) )
25982598 {
2599+ #if RETAIL_COMPATIBLE_CRC
25992600 return STATE_FAILURE; // If obj is stealthed, can no longer approach.
2601+ #else
2602+ Bool isTargetingMine = weapon && weapon->getDamageType () == DAMAGE_DISARM &&
2603+ (victim->isKindOf (KINDOF_MINE));
2604+
2605+ if (!isTargetingMine)
2606+ return STATE_FAILURE; // If obj is stealthed, can no longer approach - unless we're targeting a mine!
2607+ #endif
26002608 }
26012609 ai->setCurrentVictim (victim);
26022610 // Attacking an object.
Original file line number Diff line number Diff line change @@ -2682,7 +2682,15 @@ StateReturnType AIAttackApproachTargetState::updateInternal()
26822682 }
26832683 if ( victim->testStatus ( OBJECT_STATUS_STEALTHED ) && !victim->testStatus ( OBJECT_STATUS_DETECTED ) && !victim->testStatus ( OBJECT_STATUS_DISGUISED ) )
26842684 {
2685+ #if RETAIL_COMPATIBLE_CRC
26852686 return STATE_FAILURE; // If obj is stealthed, can no longer approach.
2687+ #else
2688+ Bool isTargetingMine = weapon && weapon->getDamageType () == DAMAGE_DISARM &&
2689+ (victim->isKindOf (KINDOF_MINE) || victim->isKindOf (KINDOF_BOOBY_TRAP) || victim->isKindOf (KINDOF_DEMOTRAP));
2690+
2691+ if (!isTargetingMine)
2692+ return STATE_FAILURE; // If obj is stealthed, can no longer approach - unless we're targeting a mine!
2693+ #endif
26862694 }
26872695 ai->setCurrentVictim (victim);
26882696 // Attacking an object.
You can’t perform that action at this time.
0 commit comments