feat(alarm): Introduce KINDOF_NO_ATTACK_WARNING#2862
Conversation
|
| Filename | Overview |
|---|---|
| Generals/Code/GameEngine/Include/Common/KindOf.h | Adds KINDOF_NO_ATTACK_WARNING enum entry in correct position before KINDOF_COUNT; follows existing alignment conventions. |
| Generals/Code/GameEngine/Source/Common/System/KindOf.cpp | Adds NO_ATTACK_WARNING to the string lookup table in the correct matching position; no issues. |
| Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp | Adds !isKindOf(KINDOF_NO_ATTACK_WARNING) guard before tryUnderAttackEvent; logically correct and the if-body remains on its own line per codebase style. |
| GeneralsMD/Code/GameEngine/Include/Common/KindOf.h | Adds KINDOF_NO_ATTACK_WARNING and KINDOF_UNUSED_1; the two new entries have inconsistent tab alignment for their ///< comments relative to each other. |
| GeneralsMD/Code/GameEngine/Source/Common/System/KindOf.cpp | Adds NO_ATTACK_WARNING and UNUSED_1 strings matching the enum order; no issues. |
| GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp | Mirrors the Generals guard addition; logically correct, consistent with existing null-check pattern for getControllingPlayer(). |
Reviews (7): Last reviewed commit: "Add unused KindOf padding bit to fix dup..." | Re-trigger Greptile
Preprocessor #if/#endif directives are not allowed indentation in this codebase; align with existing convention in the file.
a9c8238 to
acf5208
Compare
|
From my perspective (which is one from modding), I think this fix is not exactly what's needed. Hardcoding it seems the wrong way to go about it. Mods can simply make the SDZ cargo plane untargettable if they want to. It's very unlikely your opponent intercepts the plane before it drops the cash anyway. If the committee deems it absolutely necessary to have targettable SDZ planes (for the sake of distracting AA), I think a better idea is to make a system that can be applied to any object that suppresses radar alarms, like a new |
|
Agree with @WWB2-account People are trying to come up with a solution (I think this is the third PR that is trying to 'fix' this?) without first consulting / discussing what the preferable outcome should be: When (in the broadest sense) should an alarm be (re)fired. |
|
This is a big hack indeed. It totally falls apart when the Object template name is changed. |
I agree with this approach for this problem. Vote for close. |
Agree |
|
I can rework this with the new KindOf approach. |
|
Reworked PR |
This PR introduces the KINDOF_NO_ATTACK_WARNING flag. Assigning this KindOf to a unit prevents it from triggering EVA or Radar notifications for the player.