From e93175621b5d578a19530ad853e33405b8fbb275 Mon Sep 17 00:00:00 2001 From: KingRainbow44 Date: Fri, 14 Apr 2023 22:01:09 -0400 Subject: [PATCH] Use the player's selected main character when `setOwner` is called --- src/main/java/emu/grasscutter/game/avatar/Avatar.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/avatar/Avatar.java b/src/main/java/emu/grasscutter/game/avatar/Avatar.java index 4e622497e..dd3ff283c 100644 --- a/src/main/java/emu/grasscutter/game/avatar/Avatar.java +++ b/src/main/java/emu/grasscutter/game/avatar/Avatar.java @@ -204,7 +204,7 @@ public class Avatar { this.ownerId = player.getUid(); this.guid = player.getNextGameGuid(); - if (this.isMainCharacter()) { + if (this.getAvatarId() == player.getMainCharacterId()) { // Apply skill depot based on player resonance. this.changeElement(player.getMainCharacterElement(), false); } @@ -308,8 +308,6 @@ public class Avatar { * @return True if the element was changed, false otherwise. */ public boolean changeElement(@Nonnull ElementType elementTypeToChange, boolean notify) { - if (elementTypeToChange == ElementType.None) return true; - var candSkillDepotIdsList = this.getAvatarData().getCandSkillDepotIds(); var candSkillDepotIndex = elementTypeToChange.getDepotIndex();