From b93644213a66cde0c0072d1f1d45a5013861c355 Mon Sep 17 00:00:00 2001 From: Ahmad Abu-Aysha Date: Sat, 9 Sep 2023 15:01:49 +1000 Subject: [PATCH] fixed failing tests --- .../game/components/tasks/human/HumanWanderTask.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/core/src/main/com/csse3200/game/components/tasks/human/HumanWanderTask.java b/source/core/src/main/com/csse3200/game/components/tasks/human/HumanWanderTask.java index fdd38caf6..177c82558 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/human/HumanWanderTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/human/HumanWanderTask.java @@ -20,7 +20,7 @@ public class HumanWanderTask extends DefaultTask implements PriorityTask { private static final Logger logger = LoggerFactory.getLogger(HumanWanderTask.class); private final float maxRange; private final float waitTime; - private final Vector2 startPos; + private Vector2 startPos; private HumanMovementTask movementTask; private HumanWaitTask waitTask; private EngineerCombatTask combatTask; @@ -33,7 +33,6 @@ public class HumanWanderTask extends DefaultTask implements PriorityTask { public HumanWanderTask(float waitTime, float maxRange) { this.waitTime = waitTime; this.maxRange = maxRange; - this.startPos = owner.getEntity().getCenterPosition(); } @Override @@ -44,6 +43,7 @@ public int getPriority() { @Override public void start() { super.start(); + this.startPos = owner.getEntity().getCenterPosition(); waitTask = new HumanWaitTask(waitTime); waitTask.create(owner); @@ -119,8 +119,6 @@ private void swapTask(Task newTask) { } private Vector2 getDirection() { -// float y = startPos.y; -// return new Vector2(0, y); return this.startPos; } }