Browse Source

update class type when promoting

combat-2
FatBoy-DOTC 8 months ago
parent
commit
979cd70d65
  1. 5
      src/engine/gameManager/ItemManager.java
  2. 2
      src/engine/objects/PlayerCharacter.java

5
src/engine/gameManager/ItemManager.java

@ -190,7 +190,10 @@ public enum ItemManager { @@ -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.

2
src/engine/objects/PlayerCharacter.java

@ -2193,7 +2193,7 @@ public class PlayerCharacter extends AbstractCharacter { @@ -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;

Loading…
Cancel
Save