From 7ad9875533093b48f7f1221a00aa35eca4c770f0 Mon Sep 17 00:00:00 2001 From: MysterD Date: Tue, 29 Mar 2022 19:47:11 -0700 Subject: [PATCH] Properly forget sync objects even if their syncDeathEvent is false --- src/game/spawn_object.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/game/spawn_object.c b/src/game/spawn_object.c index ce6d418b..2a86dbd1 100644 --- a/src/game/spawn_object.c +++ b/src/game/spawn_object.c @@ -214,6 +214,13 @@ void unload_object(struct Object *obj) { } else { network_send_reservation_release(obj->oSyncID); } + + // forget sync object + struct SyncObject* so = &gSyncObjects[obj->oSyncID]; + if ((obj == so->o) && (obj->behavior == so->behavior)) { + network_forget_sync_object(so); + } + smlua_call_event_hooks_object_param(HOOK_ON_SYNC_OBJECT_UNLOAD, obj); }