Fix equipping items on the trailblazer

This commit is contained in:
Melledy
2024-06-19 13:46:11 -07:00
parent 85b58791a9
commit 56f259f61a
4 changed files with 8 additions and 8 deletions

View File

@@ -40,6 +40,11 @@ public class AvatarStorage extends BasePlayerManager implements Iterable<GameAva
}
public GameAvatar getAvatarById(int id) {
// Check if we are trying to retrieve the hero character
if (GameData.getHeroExcelMap().containsKey(id)) {
id = GameConstants.TRAILBLAZER_AVATAR_ID;
}
return getAvatars().get(id);
}

View File

@@ -293,7 +293,7 @@ public class GameItem {
.setMainAffixId(this.mainAffix);
if (this.getEquipAvatar() != null) {
proto.setEquipAvatarId(this.getEquipAvatar().getAvatarId());
proto.setEquipAvatarId(this.getEquipAvatar().getExcel().getId());
}
if (this.subAffixes != null) {
@@ -316,7 +316,7 @@ public class GameItem {
.setRank(this.getRank());
if (this.getEquipAvatar() != null) {
proto.setEquipAvatarId(this.getEquipAvatar().getAvatarId());
proto.setEquipAvatarId(this.getEquipAvatar().getExcel().getId());
}
return proto;

View File

@@ -564,7 +564,7 @@ public class Inventory extends BasePlayerManager {
}
public boolean unequipItem(int avatarId, int slot) {
GameAvatar avatar = getPlayer().getAvatars().getAvatarById(avatarId);
GameAvatar avatar = getPlayer().getAvatarById(avatarId);
if (avatar != null) {
GameItem unequipped = avatar.unequipItem(slot);

View File

@@ -328,11 +328,6 @@ public class Player implements Tickable {
}
public GameAvatar getAvatarById(int avatarId) {
// Check if we are trying to retrieve the hero character
if (GameData.getHeroExcelMap().containsKey(avatarId)) {
avatarId = GameConstants.TRAILBLAZER_AVATAR_ID;
}
return getAvatars().getAvatarById(avatarId);
}