Limit max radius that return to spawn behavior applies to, only submit 1 return to spawn pulse at a time.

This commit is contained in:
ceikry 2023-08-04 05:23:21 -05:00
parent e9d56fa57f
commit 90e731f7a6

View file

@ -447,10 +447,14 @@ public class NPC extends Entity {
if (
!pathBoundMovement
&& walkRadius > 0
&& walkRadius <= 20
&& !getLocation().withinDistance(getProperties().getSpawnLocation(), (int)(walkRadius * 1.5))
&& !getAttribute("no-spawn-return", false)
)
{
MovementPulse current = getAttribute("return-to-spawn-pulse");
if (current != null && current.isRunning()) return;
if(!isNeverWalks()){
if(walkRadius == 0)
walkRadius = 3;