From a52000727a98d631f0bf1e685f17cc81f834b0c6 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Sun, 16 Nov 2025 15:31:02 +1100 Subject: [PATCH 1/3] bugfix: Show weapon effects of stealthed objects for allies and observers --- Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp | 4 +--- .../Code/GameEngine/Source/GameLogic/Object/Weapon.cpp | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index 92936c3fd97..0680c268b70 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -884,9 +884,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate Bool handled; - if(!sourceObj->isLocallyControlled() // if user watching is not controller and - && sourceObj->testStatus(OBJECT_STATUS_STEALTHED) // if unit is stealthed (like a Pathfinder) - && !sourceObj->testStatus(OBJECT_STATUS_DETECTED) // but not detected... + if(!sourceObj->getDrawable()->isVisible() // if user watching cannot see us && !sourceObj->isKindOf(KINDOF_MINE) // and not a mine (which always do the FX, even if hidden)... && !isPlayFXWhenStealthed() // and not a weapon marked to playwhenstealthed ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index 76648709115..ef6da158e42 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -915,10 +915,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate Bool handled; - if(!sourceObj->isLocallyControlled() // if user watching is not controller and - && sourceObj->testStatus(OBJECT_STATUS_STEALTHED) // if unit is stealthed (like a Pathfinder) - && !sourceObj->testStatus(OBJECT_STATUS_DETECTED) // but not detected... - && !sourceObj->testStatus(OBJECT_STATUS_DISGUISED) // and not disguised... + if(!sourceObj->getDrawable()->isVisible() // if user watching cannot see us && !sourceObj->isKindOf(KINDOF_MINE) // and not a mine (which always do the FX, even if hidden)... && !isPlayFXWhenStealthed() // and not a weapon marked to playwhenstealthed ) From fc9121f571855ef0dd16879566cb924edde81b26 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Sun, 16 Nov 2025 15:32:48 +1100 Subject: [PATCH 2/3] docs: Add reminder for a future refactor --- Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp | 2 ++ GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index 0680c268b70..9d48b01e4dc 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -884,6 +884,8 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate Bool handled; + // TODO: Remove hardcoded KINDOF_MINE check and apply PlayFXWhenStealthed = Yes to the mine weapons instead. + if(!sourceObj->getDrawable()->isVisible() // if user watching cannot see us && !sourceObj->isKindOf(KINDOF_MINE) // and not a mine (which always do the FX, even if hidden)... && !isPlayFXWhenStealthed() // and not a weapon marked to playwhenstealthed diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index ef6da158e42..f9e8ba4cdaa 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -915,6 +915,8 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate Bool handled; + // TODO: Remove hardcoded KINDOF_MINE check and apply PlayFXWhenStealthed = Yes to the mine weapons instead. + if(!sourceObj->getDrawable()->isVisible() // if user watching cannot see us && !sourceObj->isKindOf(KINDOF_MINE) // and not a mine (which always do the FX, even if hidden)... && !isPlayFXWhenStealthed() // and not a weapon marked to playwhenstealthed From 2c607045f61c11c53d752e9767ed50715283aabf Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Mon, 17 Nov 2025 00:16:08 +1100 Subject: [PATCH 3/3] docs: Update comments --- Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp | 2 +- GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index 9d48b01e4dc..65439088f09 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -884,7 +884,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate Bool handled; - // TODO: Remove hardcoded KINDOF_MINE check and apply PlayFXWhenStealthed = Yes to the mine weapons instead. + // TheSuperHackers @todo: Remove hardcoded KINDOF_MINE check and apply PlayFXWhenStealthed = Yes to the mine weapons instead. if(!sourceObj->getDrawable()->isVisible() // if user watching cannot see us && !sourceObj->isKindOf(KINDOF_MINE) // and not a mine (which always do the FX, even if hidden)... diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index f9e8ba4cdaa..5c761a654cf 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -915,7 +915,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate Bool handled; - // TODO: Remove hardcoded KINDOF_MINE check and apply PlayFXWhenStealthed = Yes to the mine weapons instead. + // TheSuperHackers @todo: Remove hardcoded KINDOF_MINE check and apply PlayFXWhenStealthed = Yes to the mine weapons instead. if(!sourceObj->getDrawable()->isVisible() // if user watching cannot see us && !sourceObj->isKindOf(KINDOF_MINE) // and not a mine (which always do the FX, even if hidden)...