mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-01 14:39:13 -06:00
NPCs no longer favor the north east corner when walking
This commit is contained in:
parent
e84798c82c
commit
5e6c5bdee1
1 changed files with 2 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue