-
Notifications
You must be signed in to change notification settings - Fork 699
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
Conversation
There was a problem hiding this 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
There was a problem hiding this 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
@@ -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)) |
There was a problem hiding this comment.
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
What is this fixing or adding?
Changes a use of
self.swordless
andself.glitches_required
toself.multiworld.swordless[self.player]
andself.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.