forked from MagicBane/Server
Update to mob retaliate logic.
This commit is contained in:
@@ -1316,18 +1316,17 @@ public enum CombatManager {
|
|||||||
|
|
||||||
Mob attackedMobile = (Mob) target;
|
Mob attackedMobile = (Mob) target;
|
||||||
|
|
||||||
|
//handle minion informing his captain of an attack
|
||||||
|
|
||||||
|
if (attackedMobile.agentType.equals(AIAgentType.GUARDMINION) && attackedMobile.guardCaptain != null && attackedMobile.guardCaptain.isAlive())
|
||||||
|
if (attackedMobile.guardCaptain.combatTarget == null)
|
||||||
|
attackedMobile.guardCaptain.setCombatTarget(attacker);
|
||||||
|
|
||||||
|
// Mobile already has a target; don't switch.
|
||||||
|
|
||||||
if (attackedMobile.getCombatTarget() != null && !attackedMobile.isSiege())
|
if (attackedMobile.getCombatTarget() != null && !attackedMobile.isSiege())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//handle minion informing his captain of the attack
|
|
||||||
if (attacker.getObjectType().equals(GameObjectType.Mob)) {
|
|
||||||
Mob mob = (Mob) attacker;
|
|
||||||
if (mob.agentType.equals(AIAgentType.GUARDMINION) && mob.guardCaptain != null && mob.guardCaptain.isAlive())
|
|
||||||
if (mob.guardCaptain.combatTarget == null)
|
|
||||||
mob.guardCaptain.setCombatTarget(attacker);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
attackedMobile.setCombatTarget(attacker);
|
attackedMobile.setCombatTarget(attacker);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user