From 979cd70d65cfe07edc17d9bebf04d277c290869c Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 21 Apr 2024 13:04:47 -0500 Subject: [PATCH] update class type when promoting --- src/engine/gameManager/ItemManager.java | 5 ++++- src/engine/objects/PlayerCharacter.java | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/engine/gameManager/ItemManager.java b/src/engine/gameManager/ItemManager.java index 825843b1..e90d8b62 100644 --- a/src/engine/gameManager/ItemManager.java +++ b/src/engine/gameManager/ItemManager.java @@ -190,7 +190,10 @@ public enum ItemManager { if (!validForSkills(item, abstractCharacter.getSkills())) return false; - if (canCharacterEquip(item, abstractCharacter) == false) + if (!ValidRace(item, abstractCharacter.absRace)) + return false; + + if (!ValidClass(item, abstractCharacter.absBaseClass,abstractCharacter.absPromotionClass)) return false; //players can't wear 0 value items. diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index 6b4c35db..07f50a0d 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -2193,7 +2193,7 @@ public class PlayerCharacter extends AbstractCharacter { public boolean setPromotionClass(int value) { PromotionClass promotionClass = PromotionClass.GetPromtionClassFromCache(value); - + this.absPromotionClass = mbEnums.ClassType.valueOf(this.getPromotionClass().getName()); if (promotionClass == null) return false;