forked from MagicBane/Server
Refactor item_type
This commit is contained in:
@@ -51,7 +51,7 @@ public enum CombatManager {
|
||||
// if you carry something in the offhand thats a weapon you get to swing it
|
||||
|
||||
if (weaponOff != null)
|
||||
if (weaponOff.getItemBase().getType().equals(ItemType.WEAPON))
|
||||
if (weaponOff.template.item_type.equals(ItemType.WEAPON))
|
||||
swingOffhand = true;
|
||||
|
||||
// if you carry nothing in either hand you get to swing your offhand
|
||||
@@ -320,7 +320,7 @@ public enum CombatManager {
|
||||
else {
|
||||
ItemBase ib = weapon.getItemBase();
|
||||
|
||||
if (ib == null || !ib.getType().equals(ItemType.WEAPON))
|
||||
if (ib == null || !weapon.template.item_type.equals(ItemType.WEAPON))
|
||||
isWeapon = false;
|
||||
else
|
||||
wb = ib;
|
||||
@@ -338,7 +338,7 @@ public enum CombatManager {
|
||||
if (weaponOff != null) {
|
||||
ItemBase ib = weaponOff.getItemBase();
|
||||
|
||||
if (ib == null || !ib.getType().equals(ItemType.WEAPON))
|
||||
if (ib == null || !weaponOff.template.item_type.equals(ItemType.WEAPON))
|
||||
hasNoWeapon = true;
|
||||
else
|
||||
return 1; //no need to attack with this hand
|
||||
@@ -904,7 +904,7 @@ public enum CombatManager {
|
||||
if (ib == null)
|
||||
return false;
|
||||
|
||||
if (ib.getType().equals(ItemType.WEAPON) == false)
|
||||
if (item.template.item_type.equals(ItemType.WEAPON) == false)
|
||||
return false;
|
||||
|
||||
return ib.getRange() > MBServerStatics.RANGED_WEAPON_RANGE;
|
||||
|
||||
Reference in New Issue
Block a user