Greatly improved server performance by limiting the max wander radius return-to-spawn behavior applies to, and ensuring only one return-to-spawn movement pulse triggers at a time
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -9,8 +9,14 @@ import org.junit.jupiter.api.Assertions
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
class APITests {
|
||||
val testPlayer = TestUtils.getMockPlayer("test")
|
||||
val testPlayer2 = TestUtils.getMockPlayer("test2")
|
||||
var testPlayer: MockPlayer
|
||||
var testPlayer2: MockPlayer
|
||||
|
||||
init {
|
||||
TestUtils.preTestSetup()
|
||||
testPlayer = TestUtils.getMockPlayer("test")
|
||||
testPlayer2 = TestUtils.getMockPlayer("test2")
|
||||
}
|
||||
|
||||
@Test fun testIfaceSettings(){
|
||||
var builder = IfaceSettingsBuilder()
|
||||
|
||||
Reference in New Issue
Block a user