Browse Source

Template passed to method

combat-2
MagicBot 8 months ago
parent
commit
023fd547fd
  1. 7
      src/engine/mobileAI/utilities/CombatUtilities.java

7
src/engine/mobileAI/utilities/CombatUtilities.java

@ -201,6 +201,8 @@ public class CombatUtilities { @@ -201,6 +201,8 @@ public class CombatUtilities {
public static void combatCycle(Mob agent, AbstractWorldObject target, boolean mainHand, ItemBase wb) {
ItemTemplate template = ItemTemplate.templates.get(wb.getUUID());
if (!agent.isAlive() || !target.isAlive())
return;
@ -221,7 +223,7 @@ public class CombatUtilities { @@ -221,7 +223,7 @@ public class CombatUtilities {
if (agent.isSiege())
dt = SourceType.SIEGE;
if (wb != null) {
anim = CombatManager.getSwingAnimation(wb, null, mainHand);
anim = CombatManager.getSwingAnimation(template, null, mainHand);
dt = wb.getDamageType();
} else if (!mainHand)
return;
@ -250,7 +252,8 @@ public class CombatUtilities { @@ -250,7 +252,8 @@ public class CombatUtilities {
if (res != null && (res.immuneToAll() || res.immuneToAttacks() || res.immuneTo(dt)))
return;
int passiveAnim = CombatManager.getSwingAnimation(wb, null, mainHand);
int passiveAnim = CombatManager.getSwingAnimation(template, null, mainHand);
if (canSwing(agent)) {
if (triggerDefense(agent, target)) {
swingIsMiss(agent, target, passiveAnim);

Loading…
Cancel
Save