Give ObjectContext unk_09 field name numKeepObjects #1533
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rename unk_09 in ObjectContext to numKeepObjects. The numKeepObjects field of ObjectContext is incremented by Object_Spawn, which is only used to spawn link and objects in gameplay_keep, gameplay_field_keep, and gameplay_dangeon_keep. Thus, numKeepObjects counts the number of "keep" objects (including link) pushed to the ObjectContext status array.
On room transition, Scene_CommandObjectList iterates through objects in the ObjectContext status array from index numKeepObjects to index num - 1, keeping objects that are in the same order between the ObjectContext status array and the next room's object list and removing the rest of the objects from the ObjectContext status array (before adding new objects to the ObjectContext status array). Thus, Scene_CommandObjectList ignores "keep" objects (including link).