diff --git a/docs/Whats-New.md b/docs/Whats-New.md index 5b1410894a..98c3fd1969 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -495,6 +495,7 @@ Vanilla fixes: - Fixed an issue where some effects pointing to a unit were not properly cleared when the unit changed its owner (by TaranDahl) - Allow Reveal Crate to take effect when picking up by another player controlled house in campaign (by Trsdy) - Fixed an issue where the vanilla script ignores jumpjets. (by TaranDahl) +- Fixed the issue where trigger events 2, 53 and 54 in persistent type triggers would be activated unconditionally after activation (by FlyStar) Phobos fixes: - Fixed the bug that `AllowAirstrike=no` cannot completely prevent air strikes from being launched against it (by NetsuNegi) diff --git a/src/Ext/TEvent/Hooks.cpp b/src/Ext/TEvent/Hooks.cpp index 1fddc8ef26..3ad83e04e8 100644 --- a/src/Ext/TEvent/Hooks.cpp +++ b/src/Ext/TEvent/Hooks.cpp @@ -72,6 +72,23 @@ DEFINE_HOOK(0x726577, TEventClass_Persistable, 0x7) return 0x72657E; } +DEFINE_HOOK(0x71F9C0, TEventClass_GetStateB_SpyEvent, 0x6) +{ + enum { ReturnFalse = 0x71F9DA }; + + GET(TEventClass* const, pThis, ECX); + + switch (pThis->EventKind) + { + case TriggerEvent::SpiedBy: + case TriggerEvent::SpyAsHouse: + case TriggerEvent::SpyAsInfantry: + return ReturnFalse; + default: + return 0; + } +} + DEFINE_HOOK_AGAIN(0x71ED5E, TriggerClass_SpyAsInfantryOrHouse, 0x8) // SpyAsHouse DEFINE_HOOK(0x71ECE1, TriggerClass_SpyAsInfantryOrHouse, 0x8) // SpyAsInfantry {