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

LttP: fix percentage Triforce Pieces and missed cleanup from #3160 #3178

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

Silvris
Copy link
Collaborator

@Silvris Silvris commented Apr 19, 2024

What is this fixing or adding?

Changes a use of self.swordless and self.glitches_required to self.multiworld.swordless[self.player] and self.multiworld.glitches_required[self.player] respectively.

Round returns the datatype that was passed in, so we cast the resulting float to an int when on percentage Triforce Pieces.

How was this tested?

Generated using the offending yaml.

If this makes graphical changes, please attach screenshots.

@Silvris Silvris requested a review from Berserker66 as a code owner April 19, 2024 04:46
@github-actions github-actions bot added the waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. label Apr 19, 2024
Copy link
Contributor

@Alchav Alchav left a comment

Choose a reason for hiding this comment

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

My bad on thinking the int was unnecessary. The changes look correct. Did not test

Copy link
Member

@ThePhar ThePhar left a comment

Choose a reason for hiding this comment

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

confirmed this fixed issues I brought up here: https://discord.com/channels/731205301247803413/1214608557077700720/1230733993826189363

Going to wait for @Berserker66 to give final say though, but LGTM

@ThePhar ThePhar added is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. waiting-on: world-maintainer Issue/PR is waiting for feedback or approval by the maintainer of a world. and removed waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels Apr 19, 2024
@@ -682,7 +682,7 @@ def place_item(loc, item):
triforce_pieces = world.triforce_pieces_available[player].value + world.triforce_pieces_extra[player].value
elif world.triforce_pieces_mode[player].value == TriforcePiecesMode.option_percentage:
percentage = float(world.triforce_pieces_percentage[player].value) / 100
triforce_pieces = round(world.triforce_pieces_required[player].value * percentage, 0)
triforce_pieces = int(round(world.triforce_pieces_required[player].value * percentage, 0))
Copy link
Collaborator

Choose a reason for hiding this comment

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

another way is to remove the 0 parameter from round

@Berserker66 Berserker66 merged commit 8021ec7 into ArchipelagoMW:main Apr 19, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. waiting-on: world-maintainer Issue/PR is waiting for feedback or approval by the maintainer of a world.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants