Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add safety measure to Scene_CommandObjectList to prevent crash #3904

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion soh/soh/z_scene_otr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ bool 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.unk_09, k = 0; i < play->objectCtx.num; i++, k++) {
if (play->objectCtx.status[i].id != cmdObj->objects[k]) {
if (i >= cmdObj->objects.size() || play->objectCtx.status[i].id != cmdObj->objects[k]) {
for (j = i; j < play->objectCtx.num; j++) {
play->objectCtx.status[j].id = OBJECT_INVALID;
}
Expand Down