Fix: Shopsanity not always spawning objects for items on the shelf#2247
Merged
briaguya0 merged 1 commit intoHarbourMasters:develop-bradleyfrom Dec 24, 2022
Merged
Conversation
briaguya0
approved these changes
Dec 23, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Previously a fix was added to solve the "sold out" object not spawning in the kokiri shop, meaning the
girlaactor would get killed and its item on the shelf was empty. This fix was attempting to solve an issue where the "sold out" object was reporting as "loaded" even though it wasn't. A new issue for bugs in a bottle in the kokiri shop was displaying the same object issue.The problem was due to improper use of
Object_IsLoaded(). We were checking if the object was loaded, and if so grabbing it's index, otherwise spawning the object. We were passing in theobjectIdintoObject_IsLoaded(), but what should actually be passed in is anobjectBankIdx. Most of theobjectId's were performing an OOB access and coincidentally reporting false (aside from sold out, and now bugs in a bottle).Instead, I've updated the logic to fetch the object bank index based on the objectId with
Object_GetIndex()and if its-1then we know we need to spawn it withObject_Spawn().Confirmed this fixes #2243 and also still loads the "sold out" object.
Repro spoiler:
27-61-94-50-20.txt
Build Artifacts