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

Give ObjectContext unk_09 field name numKeepObjects #1533

Closed
wants to merge 1 commit into from

Conversation

SlyryD
Copy link

@SlyryD SlyryD commented Sep 9, 2023

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).

@fig02
Copy link
Collaborator

fig02 commented Sep 9, 2023

Hi
this is already named numPersistentEntries in #1227, which matches the rest of the proposed naming scheme there. Though, the PR has been stuck for a while due to other disagreements.

Feel free to review that PR and give your thoughts if you like.

@SlyryD
Copy link
Author

SlyryD commented Sep 9, 2023

Okay that seems fine. I messed around with this in rando and realized my name for it there was bad and I wanted it to match something here for clarity. I don't want to interrupt that massive PR.

@SlyryD SlyryD closed this Sep 9, 2023
@Dragorn421
Copy link
Collaborator

Thanks for writing a summary of how the system works around this btw, it also matches what I figured out which is always nice to check

Feel free to open such PRs again, it's uneasy to know what's already in PRs :p

@SlyryD SlyryD deleted the numkeepobjects branch September 24, 2023 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants