From a9f0b5c99ca1cd518a7f24fe58cc40a09e90cabc Mon Sep 17 00:00:00 2001 From: djoslin0 Date: Sun, 1 Mar 2026 14:43:44 -0800 Subject: [PATCH] Move HOOK_ON_ADD_SURFACE to before cell calculation (#1124) Moving it before the cell calculation should allow more possibilities in runtime collision modification Co-authored-by: MysterD --- src/engine/surface_load.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/engine/surface_load.c b/src/engine/surface_load.c index e5296490e..d78d7999d 100644 --- a/src/engine/surface_load.c +++ b/src/engine/surface_load.c @@ -271,6 +271,8 @@ static void add_surface(struct Surface *surface, s32 dynamic) { s16 cellZ, cellX; + smlua_call_event_hooks(HOOK_ON_ADD_SURFACE, surface, dynamic); + minX = min_3(surface->vertex1[0], surface->vertex2[0], surface->vertex3[0]); minZ = min_3(surface->vertex1[2], surface->vertex2[2], surface->vertex3[2]); maxX = max_3(surface->vertex1[0], surface->vertex2[0], surface->vertex3[0]); @@ -287,7 +289,6 @@ static void add_surface(struct Surface *surface, s32 dynamic) { } } - smlua_call_event_hooks(HOOK_ON_ADD_SURFACE, surface, dynamic); } /**