Browse Source

cleanup

master
FatBoy-DOTC 2 years ago
parent
commit
cfd93f2ca0
  1. 11
      src/engine/ai/utilities/CombatUtilities.java

11
src/engine/ai/utilities/CombatUtilities.java

@ -295,7 +295,7 @@ public class CombatUtilities { @@ -295,7 +295,7 @@ public class CombatUtilities {
swingIsBlock(agent, target, passiveAnim);
return;
}
swingIsDamage(agent,target, determineDamage(agent,target), anim);
swingIsDamage(agent,target, determineDamage(agent), anim);
if (agent.getWeaponPower() != null)
agent.getWeaponPower().attack(target, MBServerStatics.ONE_MINUTE);
@ -326,11 +326,16 @@ public class CombatUtilities { @@ -326,11 +326,16 @@ public class CombatUtilities {
}
public static float determineDamage(Mob agent,AbstractWorldObject target) {
if(agent == null || target == null){
public static float determineDamage(Mob agent) {
if(agent == null){
//early exit for null
return 0;
}
AbstractWorldObject target = agent.getCombatTarget();
if(target == null){
//early exit for null target
return 0;
}
float damage = 0;
DamageType dt = getDamageType(agent);
if(agent.isSummonedPet() == true || agent.isPet() == true || agent.isNecroPet() == true) {

Loading…
Cancel
Save