Skip to content

Commit 946337e

Browse files
committed
Support the case when nothing in selection
1 parent fd36e64 commit 946337e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Misc/Observers.Visibility.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,20 @@ DEFINE_HOOK(0x4ABE3C, DisplayClass_MouseLeftRelease_Cloak, 0xA)
125125
return Unselect;
126126
}
127127

128+
DEFINE_HOOK(0x692686, DisplayClass_DecideAction_Cloak, 0x6)
129+
{
130+
GET(TechnoClass*, pTechno, EDI);
131+
enum { ProceedCloakCheck = 0x692690, ShouldNotCheck = 0x6926DB };
132+
133+
if (pTechno->IsOwnedByCurrentPlayer || HouseClass::IsCurrentPlayerObserver())
134+
return ShouldNotCheck;
135+
136+
if (pTechno->Owner->IsMutualAllie(HouseClass::CurrentPlayer))
137+
return ShouldNotCheck;
138+
139+
return ProceedCloakCheck;
140+
}
141+
128142
// Show cloaked Technos on radar for observers and mutual allies
129143
DEFINE_HOOK(0x70D386, TechnoClass_Radar_Cloak, 0xA)
130144
{

0 commit comments

Comments
 (0)