Skip to content

Commit

Permalink
Fix ghosts not being generated when leaving radar coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
saurtron committed Jan 9, 2025
1 parent afd9a07 commit bb41bc9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions rts/Rendering/Units/UnitDrawerData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion rts/Rendering/Units/UnitDrawerData.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class CUnitDrawerData : public CUnitDrawerDataBase {
void RenderUnitDestroyed(const CUnit* unit) override;

void UnitEnteredRadar(const CUnit* unit, int allyTeam) override;
void UnitLeftRadar(const CUnit* unit, int allyTeam) override { UnitEnteredRadar(unit, allyTeam); }
void UnitLeftRadar(const CUnit* unit, int allyTeam) override;

void UnitEnteredLos(const CUnit* unit, int allyTeam) override;
void UnitLeftLos(const CUnit* unit, int allyTeam) override;
Expand Down

0 comments on commit bb41bc9

Please sign in to comment.