From 3a1865109a29e3a8e055d678c7103c0636e45f8a Mon Sep 17 00:00:00 2001 From: Saurtron Date: Thu, 9 Jan 2025 11:34:43 +0100 Subject: [PATCH] Add CUnitDrawerData::UnitLeftRadar so dead ghosts will be generated also when radar coverage dissapears from a spotted unit. --- rts/Rendering/Units/UnitDrawerData.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rts/Rendering/Units/UnitDrawerData.cpp b/rts/Rendering/Units/UnitDrawerData.cpp index 48fe676de4..78e95f5d66 100644 --- a/rts/Rendering/Units/UnitDrawerData.cpp +++ b/rts/Rendering/Units/UnitDrawerData.cpp @@ -651,6 +651,16 @@ void CUnitDrawerData::UnitEnteredRadar(const CUnit* unit, int allyTeam) UpdateUnitIcon(unit, false, false); } +void CUnitDrawerData::UnitLeftRadar(const CUnit* unit, int allyTeam) +{ + if (allyTeam != gu->myAllyTeam) + return; + + UpdateUnitGhosts(unit, unit->leavesGhost); + + UpdateUnitIcon(unit, false, false); +} + void CUnitDrawerData::UnitEnteredLos(const CUnit* unit, int allyTeam) { RECOIL_DETAILED_TRACY_ZONE;