tweak(radar): Suppress under attack radar notification spam - #2540
Conversation
|
| Filename | Overview |
|---|---|
| Core/GameEngine/Source/Common/System/Radar.cpp | Regression fix: forces global suppression for RADAR_EVENT_UNDER_ATTACK via PRESERVE_RETAIL_BEHAVIOR guard; logic is correct and minimal |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Radar::tryEvent called\nevent, pos] --> B{Valid event\nand pos?}
B -- No --> C[return FALSE]
B -- Yes --> D[Loop over MAX_RADAR_EVENTS]
D --> E{m_event[i].type\n== event?}
E -- No --> D
E -- Yes --> F[Compute distSquared\nfrom existing event]
F --> G[isClose = distSquared\n<= 250*250]
G --> H{PRESERVE_RETAIL_BEHAVIOR\n&& event ==\nRADAR_EVENT_UNDER_ATTACK?}
H -- Yes --> I[isClose = true\nglobal suppression]
H -- No --> J{isClose?}
I --> J
J -- No --> D
J -- Yes --> K{currentFrame - createFrame\n< 10 seconds?}
K -- Yes --> L[return FALSE\nsuppress notification]
K -- No --> D
D -- All slots checked --> M[createEvent\nreturn TRUE]
Reviews (3): Last reviewed commit: "fix vc6 compile warning" | Re-trigger Greptile
…Hackers#2540) When PRESERVE_RETAIL_BEHAVIOR is not zero
#2368 fixing the engine's radar math inadvertently caused the 10-second suppression timer to only apply within a 250-unit radius. This resulted in constant, overlapping beeps during cross-map engagements and for USA factions.
This restores the original global retail cooldown behavior. The notification system still has known (design) issues and needs a few patches; this just fixes the regression first.