Fix RLS crates not dropping for grouped players#410
Merged
Conversation
xp.VAR_TOP_GROUP stores the GROUP object ID when the top attacker is in a group, not an individual player. The isPlayer() guard in addRareLoot() was then failing immediately, preventing any RLS chest from spawning whenever players were grouped. Pick a random member of the group as the RLS recipient, consistent with how other group loot mechanics work in the codebase. Fixes #343
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.
Summary
Rare Loot System (RLS) chests never dropped for grouped players. Solo play was unaffected.
Root cause:
xp.VAR_TOP_GROUPstores a group object ID when the top damage dealer is part of a group (seexp.javaline 824-836). Inloot.addRareLoot(), this value is treated as the player recipient and immediately fails theisPlayer()check, returningfalsebefore any roll is made.Fix:
Detect when
VAR_TOP_GROUPholds a group object and resolve it to a random group member. This matches how other group loot mechanics are handled throughout the codebase (e.g.,chooseRandomLootPlayerFromGroup).Fixes #343