Fixed stackoverflow errors from movement.
Contributed by Sahar.
This commit is contained in:
		| @@ -692,7 +692,7 @@ public abstract class AbstractAI implements Ctrl | ||||
| 	 | ||||
| 	public boolean isFollowing() | ||||
| 	{ | ||||
| 		return (_target != null) && _target.isCreature() && (_intention == AI_INTENTION_FOLLOW); | ||||
| 		return (_target != null) && _target.isCreature() && ((_intention == AI_INTENTION_FOLLOW) || CreatureFollowTaskManager.getInstance().isFollowing(_actor)); | ||||
| 	} | ||||
| 	 | ||||
| 	/** | ||||
|   | ||||
| @@ -126,16 +126,21 @@ public class CreatureFollowTaskManager | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| 	public boolean isFollowing(Creature creature) | ||||
| 	{ | ||||
| 		return NORMAL_FOLLOW_CREATURES.containsKey(creature) || ATTACK_FOLLOW_CREATURES.containsKey(creature); | ||||
| 	} | ||||
| 	 | ||||
| 	public void addNormalFollow(Creature creature, int range) | ||||
| 	{ | ||||
| 		follow(creature, range); | ||||
| 		NORMAL_FOLLOW_CREATURES.putIfAbsent(creature, range); | ||||
| 		follow(creature, range); | ||||
| 	} | ||||
| 	 | ||||
| 	public void addAttackFollow(Creature creature, int range) | ||||
| 	{ | ||||
| 		follow(creature, range); | ||||
| 		ATTACK_FOLLOW_CREATURES.putIfAbsent(creature, range); | ||||
| 		follow(creature, range); | ||||
| 	} | ||||
| 	 | ||||
| 	public void remove(Creature creature) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 MobiusDevelopment
					MobiusDevelopment