From 41c93e06e22653f141e69f05d788a6d1d1eaa586 Mon Sep 17 00:00:00 2001 From: l0ftyWhizZ Date: Mon, 26 Mar 2018 15:42:03 +0530 Subject: [PATCH] Changed the instigator to the closest character instead of the first from the charactersWithinRange list. --- .../terasology/behaviors/actions/FleeFromCharacterAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/terasology/behaviors/actions/FleeFromCharacterAction.java b/src/main/java/org/terasology/behaviors/actions/FleeFromCharacterAction.java index c2860234..74e93732 100644 --- a/src/main/java/org/terasology/behaviors/actions/FleeFromCharacterAction.java +++ b/src/main/java/org/terasology/behaviors/actions/FleeFromCharacterAction.java @@ -28,7 +28,7 @@ public class FleeFromCharacterAction extends BaseAction { public void construct(Actor actor) { FleeComponent fleeComponent = new FleeComponent(); FindNearbyPlayersComponent component = actor.getComponent(FindNearbyPlayersComponent.class); - fleeComponent.instigator = component.charactersWithinRange.get(0); + fleeComponent.instigator = component.closestCharacter; actor.save(fleeComponent); }