Skip to content

Commit da248f6

Browse files
committed
Refine the fix in previous commit
1 parent 5d5573b commit da248f6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Misc/Hooks.BugFixes.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -922,13 +922,12 @@ DEFINE_HOOK(0x705D74, TechnoClass_GetRemapColour_DisguisePalette, 0x8)
922922
// Fixes an edge case crash caused by temporal targeting enslaved infantry.
923923
DEFINE_HOOK(0x71ADE4, TemporalClass_Release_SlaveTargetFix, 0x5)
924924
{
925-
GET(TemporalClass* const, pThis, ESI);
925+
enum { ReturnFromFunction = 0x71AE47 };
926926

927-
if (pThis->PrevTemporal == pThis)
928-
pThis->PrevTemporal = nullptr;
927+
GET(TemporalClass* const, pThis, ESI);
929928

930-
if (pThis->NextTemporal == pThis)
931-
pThis->NextTemporal = nullptr;
929+
if (!pThis->Target)
930+
return ReturnFromFunction;
932931

933932
return 0;
934933
}

0 commit comments

Comments
 (0)