From 478d28ed7dab9ae08f43c4d2f399d3ee16074541 Mon Sep 17 00:00:00 2001 From: MeltyPlayer Date: Thu, 20 Oct 2022 00:01:51 -0500 Subject: [PATCH] Carried over a NPE fix from @ckosmic's fork. --- src/decomp/game/mario.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/decomp/game/mario.c b/src/decomp/game/mario.c index 34f2fc0..bb33cc2 100644 --- a/src/decomp/game/mario.c +++ b/src/decomp/game/mario.c @@ -1329,7 +1329,9 @@ void update_mario_geometry_inputs(struct MarioState *m) { m->floorHeight = find_floor(m->pos[0], m->pos[1], m->pos[2], &m->floor); - m->curTerrain = m->floor->terrain; + if(m->floor != NULL) { + m->curTerrain = m->floor->terrain; + } // If Mario is OOB, move his position to his graphical position (which was not updated) // and check for the floor there.