Skip to content

Commit

Permalink
Support the case when nothing in selection
Browse files Browse the repository at this point in the history
  • Loading branch information
chaserli committed Dec 17, 2024
1 parent fd36e64 commit 946337e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Misc/Observers.Visibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,20 @@ DEFINE_HOOK(0x4ABE3C, DisplayClass_MouseLeftRelease_Cloak, 0xA)
return Unselect;
}

DEFINE_HOOK(0x692686, DisplayClass_DecideAction_Cloak, 0x6)
{
GET(TechnoClass*, pTechno, EDI);
enum { ProceedCloakCheck = 0x692690, ShouldNotCheck = 0x6926DB };

if (pTechno->IsOwnedByCurrentPlayer || HouseClass::IsCurrentPlayerObserver())
return ShouldNotCheck;

if (pTechno->Owner->IsMutualAllie(HouseClass::CurrentPlayer))
return ShouldNotCheck;

return ProceedCloakCheck;
}

// Show cloaked Technos on radar for observers and mutual allies
DEFINE_HOOK(0x70D386, TechnoClass_Radar_Cloak, 0xA)
{
Expand Down

0 comments on commit 946337e

Please sign in to comment.