Skip to content

Commit ffe807b

Browse files
committed
Fix RLS crates not dropping for grouped players
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
1 parent adabbb8 commit ffe807b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • sku.0/sys.server/compiled/game/script/library

sku.0/sys.server/compiled/game/script/library/loot.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2491,6 +2491,14 @@ public static boolean addRareLoot(obj_id target) throws InterruptedException
24912491
// get the attacker who did the most damage.
24922492
obj_id player = getObjIdObjVar(target, xp.VAR_TOP_GROUP);
24932493

2494+
// VAR_TOP_GROUP stores a group object when the top damage dealer is grouped.
2495+
// Pick a random member of that group to receive the RLS chest.
2496+
if (group.isGroupObject(player)) {
2497+
obj_id[] members = utils.getLocalGroupMemberIds(player);
2498+
if (members == null || members.length == 0) return false;
2499+
player = members[rand(0, members.length - 1)];
2500+
}
2501+
24942502
// make sure the attacker is a player.
24952503
if(!isValidId(player) || !isPlayer(player)){
24962504
return false;

0 commit comments

Comments
 (0)