Skip to content

Commit 6065e12

Browse files
committed
Use SELECT cursor on cloaked objects as ally or observer (split from #20)
1 parent 19bfb91 commit 6065e12

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_WhatAction_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->IsMutualAlly(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)