fix scene object unload (#129)

This commit is contained in:
Archez
2024-05-22 09:04:59 -05:00
committed by Garrett Cox
parent a2ae88987a
commit 61c2764eef
+2 -2
View File
@@ -170,7 +170,7 @@ void Scene_CommandObjectList(PlayState* play, LUS::ISceneCommand* cmd) {
// Loop until a mismatch in the object lists
// Then clear all object ids past that in the context object list and kill actors for those objects
for (i = play->objectCtx.numPersistentEntries, k = 0; i < play->objectCtx.numEntries; i++, k++) {
if (play->objectCtx.slots[i].id != objList->objects[k]) {
if (k >= objList->objects.size() || play->objectCtx.slots[i].id != objList->objects[k]) {
for (j = i; j < play->objectCtx.numEntries; j++) {
play->objectCtx.slots[j].id = 0;
}
@@ -523,4 +523,4 @@ extern "C" s32 OTRfunc_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomN
}
return 0;
}
}