Fix loot reward system scale logic in BannerKings - #207
Open
f3bot wants to merge 1 commit into
Open
Conversation
Problem:
The loot scaling system incorrectly discards all items when set to 100%, despite the description stating that 100% reflects vanilla behavior where all loot is retained. The issue lies in the comparator sign, causing the loot scale to always exceed the random float, resulting in no items being looted.
Solution:
Adjusted the comparator logic so that at 100% scale, all items are looted, aligning with the setting description.
This change ensures that scaling works intuitively — lower percentages reduce loot, while 100% reliably retains all loot.
Result:
Setting loot scale to 100% now correctly retains all items, and lowering the percentage progressively reduces the loot pool, matching player expectations and the in-game description.
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.
Fix loot reward scaling logic in BKBattleRewardModel
Problem:
The loot scaling system incorrectly discarded all items when the loot scale was set to 100%, despite the description stating that 100% should retain all loot. The issue came from the comparator sign, causing loot to be discarded whenever the scale was greater than the random float.
Solution:
Result:
This fix aligns the loot system behavior with the settings menu description and player expectations.