fixed pet attack and null weapon combat issue
This commit is contained in:
@@ -225,7 +225,8 @@ public enum CombatManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// take stamina away from attacker
|
||||||
|
if (weapon != null) {
|
||||||
//check if Out of Stamina
|
//check if Out of Stamina
|
||||||
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
||||||
if (attacker.getStamina() < (weapon.template.item_wt / 3f)) {
|
if (attacker.getStamina() < (weapon.template.item_wt / 3f)) {
|
||||||
@@ -234,13 +235,11 @@ public enum CombatManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// take stamina away from attacker
|
|
||||||
if (weapon != null) {
|
|
||||||
float stam = weapon.template.item_wt / 3f;
|
float stam = weapon.template.item_wt / 3f;
|
||||||
stam = (stam < 1) ? 1 : stam;
|
stam = (stam < 1) ? 1 : stam;
|
||||||
attacker.modifyStamina(-(stam), attacker, true);
|
attacker.modifyStamina(-(stam), attacker, true);
|
||||||
} else
|
} else
|
||||||
attacker.modifyStamina(-0.5f, attacker, true);
|
attacker.modifyStamina(1, attacker, true);
|
||||||
|
|
||||||
//cancel things that are cancelled by an attack
|
//cancel things that are cancelled by an attack
|
||||||
|
|
||||||
|
|||||||
@@ -46,9 +46,6 @@ public class PetAttackMsgHandler extends AbstractClientMsgHandler {
|
|||||||
if (!pet.isAlive())
|
if (!pet.isAlive())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (pet.getCombatTarget() == null)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if ((playerCharacter.inSafeZone())
|
if ((playerCharacter.inSafeZone())
|
||||||
&& (msg.getTargetType() == mbEnums.GameObjectType.PlayerCharacter.ordinal()))
|
&& (msg.getTargetType() == mbEnums.GameObjectType.PlayerCharacter.ordinal()))
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user