From 67966c53a0b52c35be461e47cafb833cec8105ee Mon Sep 17 00:00:00 2001 From: n64 Date: Wed, 30 Sep 2020 23:18:30 +0200 Subject: [PATCH] Fix crash with dynamic surfaces --- src/engine/surface_load.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/engine/surface_load.c b/src/engine/surface_load.c index b447dc2..e6551b2 100644 --- a/src/engine/surface_load.c +++ b/src/engine/surface_load.c @@ -634,6 +634,10 @@ void load_area_terrain(s16 index, s16 *data, s8 *surfaceRooms, s16 *macroObjects alloc_only_pool_clear(sDynamicSurfaceNodePool); alloc_only_pool_clear(sDynamicSurfacePool); sStaticSurfaceLoadComplete = FALSE; + + // Originally they forgot to clear this matrix, + // results in segfaults if this is not done. + clear_dynamic_surfaces(); #endif clear_static_surfaces();