From a2dd0e502a720cda55a104b6d5e44bf6ba4123d4 Mon Sep 17 00:00:00 2001 From: "Luis C.M" Date: Wed, 4 May 2022 03:10:16 -0500 Subject: [PATCH] Slightly improved return to start checks --- src/main/java/noppes/npcs/ai/EntityAIReturn.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/noppes/npcs/ai/EntityAIReturn.java b/src/main/java/noppes/npcs/ai/EntityAIReturn.java index 157dd6b7b..9c3988ac3 100644 --- a/src/main/java/noppes/npcs/ai/EntityAIReturn.java +++ b/src/main/java/noppes/npcs/ai/EntityAIReturn.java @@ -30,11 +30,15 @@ public class EntityAIReturn extends EntityAIBase * Returns whether the EntityAIBase should begin execution. */ public boolean shouldExecute() { + if (!npc.ai.returnToStart){ + return false; + } + if (npc.getNavigator().noPath() || (!npc.isAttacking() && wasAttacked)){ return true; } - if(npc.hasOwner() || !npc.ai.returnToStart || npc.isKilled() || npc.isInteracting()){ + if(npc.hasOwner() || npc.isKilled() || npc.isInteracting()){ return false; }