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

Remove use of static variable in en_box #3536

Merged

Conversation

garrettjoecox
Copy link
Contributor

@garrettjoecox garrettjoecox commented Dec 18, 2023

I'm basically removing all of this rando specific code in rando v3, so for now a bandaid that touches the least amount possible.

This was probably the source of #1565

Build Artifacts

@@ -628,7 +627,7 @@ void EnBox_Update(Actor* thisx, PlayState* play) {
}

if (((!IS_RANDO && ((this->dyna.actor.params >> 5 & 0x7F) == 0x7C)) ||
(IS_RANDO && ABS(sItem.getItemId) == RG_ICE_TRAP)) &&
(IS_RANDO && this->getItemEntry.getItemId == RG_ICE_TRAP)) &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you know why we used to have ABS here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the static sItem was what was handed off to player, with the getItemId negated (which allows the player to interact with the chest)

Now this just uses the this->getItemEntry I added later on for Chest Style Matches Contents.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See

// Chests need to have a negative getItemId in order to not immediately give their item
// when approaching.
if (IS_RANDO) {
sItem.getItemId = 0 - sItem.getItemId;
sItem.getItemFrom = ITEM_FROM_CHEST;
GiveItemEntryFromActorWithFixedRange(&this->dyna.actor, play, sItem);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case you're wondering, we should be able to just replace what's left of sItem with this->getItemEntry, but this is all going away anyway so I erred on the side of safety and just left most of it untouched.

@garrettjoecox garrettjoecox merged commit ef910a0 into HarbourMasters:develop-macready Dec 18, 2023
8 checks passed
@garrettjoecox garrettjoecox deleted the fix-chest-static branch March 4, 2024 15:33
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