From 6396b38a6f2cb90bf8f4f801c26f35d3d4d689b6 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Fri, 11 Aug 2023 00:02:59 +0200 Subject: [PATCH] port: fix (?) crash related to knocking out the secretary in defection --- src/game/chraction.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/game/chraction.c b/src/game/chraction.c index 015559cb9..3266089ea 100644 --- a/src/game/chraction.c +++ b/src/game/chraction.c @@ -8490,6 +8490,12 @@ void chrTickDruggedComingUp(struct chrdata *chr) chrUncloak(chr, true); chr->actiontype = ACT_DRUGGEDDROP; +#ifdef AVOID_UB + // the function that checks notifychrindex checks for ACT_DRUGGEDDROP, + // so in theory it could check it before the drop animation is finished, + // which will cause a crash. or at least I think that's what's happening + chr->act_die.notifychrindex = 0; +#endif while (!done) { if (i >= 0