From 9671a76af208f2f401dbcbc36bd7cb0bbf7b5905 Mon Sep 17 00:00:00 2001 From: AnimeGitB Date: Sat, 17 Sep 2022 01:31:23 +0930 Subject: [PATCH] character and companionship exp gain to party not active character fixes #1787 --- .../java/emu/grasscutter/game/inventory/Inventory.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/inventory/Inventory.java b/src/main/java/emu/grasscutter/game/inventory/Inventory.java index 7a7c7fc19..e65b01fc3 100644 --- a/src/main/java/emu/grasscutter/game/inventory/Inventory.java +++ b/src/main/java/emu/grasscutter/game/inventory/Inventory.java @@ -273,11 +273,15 @@ public class Inventory extends BasePlayerManager implements Iterable { private void addVirtualItem(int itemId, int count) { switch (itemId) { case 101 -> // Character exp - this.player.getServer().getInventorySystem().upgradeAvatar(this.player, this.player.getTeamManager().getCurrentAvatarEntity().getAvatar(), count); + this.player.getTeamManager().getActiveTeam().stream().map(e -> e.getAvatar()).forEach( + avatar -> this.player.getServer().getInventorySystem().upgradeAvatar(this.player, avatar, count) + ); case 102 -> // Adventure exp this.player.addExpDirectly(count); case 105 -> // Companionship exp - this.player.getServer().getInventorySystem().upgradeAvatarFetterLevel(this.player, this.player.getTeamManager().getCurrentAvatarEntity().getAvatar(), count); + this.player.getTeamManager().getActiveTeam().stream().map(e -> e.getAvatar()).forEach( + avatar -> this.player.getServer().getInventorySystem().upgradeAvatarFetterLevel(this.player, avatar, count * (this.player.isInMultiplayer() ? 2 : 1)) + ); case 106 -> // Resin this.player.getResinManager().addResin(count); case 107 -> // Legendary Key