From 5e6c5bdee167580e13e278ce255ba4939a917d3b Mon Sep 17 00:00:00 2001 From: Tooze Date: Fri, 3 Jul 2026 08:59:43 +0000 Subject: [PATCH] NPCs no longer favor the north east corner when walking --- Server/src/main/core/game/node/entity/npc/NPC.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Server/src/main/core/game/node/entity/npc/NPC.java b/Server/src/main/core/game/node/entity/npc/NPC.java index b8139e66a..d0e349d7c 100644 --- a/Server/src/main/core/game/node/entity/npc/NPC.java +++ b/Server/src/main/core/game/node/entity/npc/NPC.java @@ -767,7 +767,8 @@ public class NPC extends Entity { */ protected Location getMovementDestination() { if (!pathBoundMovement || movementPath == null || movementPath.length < 1) { - Location returnToSpawnLocation = getProperties().getSpawnLocation().transform(-5 + RandomFunction.random(getWalkRadius()), -5 + RandomFunction.random(getWalkRadius()), 0); + int radius = getWalkRadius() / 2; + Location returnToSpawnLocation = getProperties().getSpawnLocation().transform(RandomFunction.random(-radius, radius+1), RandomFunction.random(-radius, radius+1), 0); int dist = (int) Location.getDistance(location, returnToSpawnLocation); int pathLimit = 14; if (dist > pathLimit) {