Fixed a bug where an NPC could not attack an entity that was already set as their target
Fixed a regression that prevents some NPCs from walking back to their spawn point Fixed a longstanding issue that didn't properly reset NPCs who wandered too far out of their natural movement radius (now disables combat + walks them back to their spawn point + fully heals them)
This commit is contained in:
@@ -286,7 +286,8 @@ class CombatPulse(
|
||||
victim.skills.updateLevel(Skills.DEFENCE, -drain, victim.skills.getStaticLevel(Skills.DEFENCE) - drain)
|
||||
}
|
||||
}
|
||||
victim.walkingQueue.reset()
|
||||
if (!victim.locks.isMovementLocked)
|
||||
victim.walkingQueue.reset()
|
||||
}
|
||||
setVictim(victim)
|
||||
entity.onAttack(victim as Entity?)
|
||||
|
||||
@@ -210,6 +210,10 @@ abstract class CombatSwingHandler(var type: CombatStyle?) {
|
||||
* @return `True` if so.
|
||||
*/
|
||||
open fun isAttackable(entity: Entity, victim: Entity): InteractionType? {
|
||||
if (victim.getAttribute("return-to-spawn", false)) {
|
||||
return InteractionType.NO_INTERACT
|
||||
}
|
||||
|
||||
if (type == CombatStyle.MELEE) {
|
||||
val stepType = canStepTowards(entity, victim)
|
||||
if (stepType != InteractionType.STILL_INTERACT) return stepType
|
||||
|
||||
Reference in New Issue
Block a user