From c7a85d503f15e430057a4a2d3d49422e20e397f9 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 12 Nov 2022 19:47:44 +1000 Subject: [PATCH] Fix chrs' inability to remain patient while on a lift --- src/game/chraction.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/game/chraction.c b/src/game/chraction.c index c04177f7d..a17622db0 100644 --- a/src/game/chraction.c +++ b/src/game/chraction.c @@ -11609,7 +11609,7 @@ void chrNavTickMain(struct chrdata *chr, struct coord *nextpos, struct waydata * bool chrGoPosUpdateLiftAction(struct chrdata *chr, u32 curpadflags, bool arg2, bool arrivingatlift, s16 curpadnum, s32 nextpadnum) { bool advance = false; - struct pad *nextpad; + struct pad *nextpad = NULL; u32 nextpadflags = 0; f32 nextground; f32 lifty; @@ -11626,6 +11626,7 @@ bool chrGoPosUpdateLiftAction(struct chrdata *chr, u32 curpadflags, bool arg2, b lifty = liftGetY(lift); if (nextpadnum >= 0) { + nextpad = &g_Pads[nextpadnum]; nextpadflags = nextpad->flags; } @@ -11656,7 +11657,7 @@ bool chrGoPosUpdateLiftAction(struct chrdata *chr, u32 curpadflags, bool arg2, b chrChooseStandAnimation(chr, 16); - if (nextpadnum >= 0) { + if (nextpad) { // Call the lift chrOpenDoor(chr, &nextpad->pos); }