From b5a009f2e2e0fe865c939b297a36755a1fd570f7 Mon Sep 17 00:00:00 2001 From: Misa Date: Tue, 19 May 2020 21:32:53 -0700 Subject: [PATCH] Reset game.activeactivity and game.act_fade in scriptclass::hardreset() Resetting game.activeactivity fixes triggering Undefined Behavior if you quit to the menu while standing inside an activity zone, and then re-entered the game. Resetting game.act_fade also fixes the activity zone prompt fadeout that happens once the above segfault is fixed. Don't worry, other activity-zone like variables such as teleporter prompts and trophy text are already covered. obj.trophytext is reset in scriptclass::hardreset(), too, and game.readytotele is reset every time mapclass::gotoroom() is called, and mapclass::gotoroom() is called every time a gamemode is started. --- desktop_version/src/Script.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index 6089b9ac..58e920a2 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -3503,6 +3503,9 @@ void scriptclass::hardreset() game.flashlight = 0; game.screenshake = 0; + game.activeactivity = -1; + game.act_fade = 5; + //dwgraphicsclass graphics.backgrounddrawn = false; graphics.textboxremovefast();