Skip to content

Commit 44dbf0a

Browse files
authored
bugfix(weapon): Show weapon effects of stealthed objects for allies and observers (#1865)
1 parent c9b32b2 commit 44dbf0a

File tree

2 files changed

+6
-7
lines changed
  • GeneralsMD/Code/GameEngine/Source/GameLogic/Object
  • Generals/Code/GameEngine/Source/GameLogic/Object

2 files changed

+6
-7
lines changed

Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -884,9 +884,9 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate
884884

885885
Bool handled;
886886

887-
if(!sourceObj->isLocallyControlled() // if user watching is not controller and
888-
&& sourceObj->testStatus(OBJECT_STATUS_STEALTHED) // if unit is stealthed (like a Pathfinder)
889-
&& !sourceObj->testStatus(OBJECT_STATUS_DETECTED) // but not detected...
887+
// TheSuperHackers @todo: Remove hardcoded KINDOF_MINE check and apply PlayFXWhenStealthed = Yes to the mine weapons instead.
888+
889+
if(!sourceObj->getDrawable()->isVisible() // if user watching cannot see us
890890
&& !sourceObj->isKindOf(KINDOF_MINE) // and not a mine (which always do the FX, even if hidden)...
891891
&& !isPlayFXWhenStealthed() // and not a weapon marked to playwhenstealthed
892892
)

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -915,10 +915,9 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate
915915

916916
Bool handled;
917917

918-
if(!sourceObj->isLocallyControlled() // if user watching is not controller and
919-
&& sourceObj->testStatus(OBJECT_STATUS_STEALTHED) // if unit is stealthed (like a Pathfinder)
920-
&& !sourceObj->testStatus(OBJECT_STATUS_DETECTED) // but not detected...
921-
&& !sourceObj->testStatus(OBJECT_STATUS_DISGUISED) // and not disguised...
918+
// TheSuperHackers @todo: Remove hardcoded KINDOF_MINE check and apply PlayFXWhenStealthed = Yes to the mine weapons instead.
919+
920+
if(!sourceObj->getDrawable()->isVisible() // if user watching cannot see us
922921
&& !sourceObj->isKindOf(KINDOF_MINE) // and not a mine (which always do the FX, even if hidden)...
923922
&& !isPlayFXWhenStealthed() // and not a weapon marked to playwhenstealthed
924923
)

0 commit comments

Comments
 (0)