Browse Source

bug #1941

tags/v0.12.0
Shaun 1 year ago
parent
commit
6cb3a3af81
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      src/server/components/mob.js

+ 6
- 2
src/server/components/mob.js View File

@@ -138,7 +138,7 @@ module.exports = {
}

if (!this.goHome) {
//Are we too far from home?
//Are we chasing a target too far from home?
if (!obj.follower && target) {
if (!this.canChase(target)) {
obj.clearQueue();
@@ -147,7 +147,11 @@ module.exports = {
}
}

if ((target) && (target !== obj) && ((!obj.follower) || (obj.follower.master !== target))) {
//Are we too far from home?
let distanceFromHome = Math.max(abs(this.originX - obj.x), abs(this.originY - obj.y));
if (distanceFromHome > this.maxChaseDistance)
this.goHome = true;
else if ((target) && (target !== obj) && ((!obj.follower) || (obj.follower.master !== target))) {
//If we just started attacking, patrols need to know where home is
if (!this.target && this.patrol) {
this.originX = obj.x;


Loading…
Cancel
Save