Properly forget sync objects even if their syncDeathEvent is false

This commit is contained in:
MysterD 2022-03-29 19:47:11 -07:00
parent bf7066e9e3
commit ee8257475d
1 changed files with 7 additions and 0 deletions

View File

@ -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);
}