From 1485ee9275b94388767e7b269e228ba413d9f54d Mon Sep 17 00:00:00 2001 From: Player Name Date: Wed, 10 Jun 2026 15:56:09 +0200 Subject: [PATCH] No need for logging, thanks ceik --- Server/src/main/core/game/node/entity/Entity.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Server/src/main/core/game/node/entity/Entity.java b/Server/src/main/core/game/node/entity/Entity.java index 80134781a..0203fd3e3 100644 --- a/Server/src/main/core/game/node/entity/Entity.java +++ b/Server/src/main/core/game/node/entity/Entity.java @@ -17,7 +17,6 @@ import core.game.node.entity.player.link.TeleportManager; import core.game.node.entity.skill.Skills; import core.game.system.task.Pulse; import core.game.world.map.zone.ZoneRestriction; -import core.tools.Log; import org.jetbrains.annotations.NotNull; import core.game.world.GameWorld; import core.game.world.map.Location; @@ -34,8 +33,6 @@ import core.game.system.timer.TimerRegistry; import java.util.*; -import static core.api.ContentAPIKt.log; - /** * An entity is a movable node, such as players and NPCs. * @author Emperor @@ -239,9 +236,9 @@ public abstract class Entity extends Node { */ public void clear() { active = false; - if (location == null) { - log(getClass(), Log.ERR, "Null location when clearing Entity " + getId()); - } else { + if (location != null) { + // Location can be null if the Entity never got init()ed, for example if NPC(...) was called only to show a face during dialogues. + // In that situation, the NPC never actually got created so it doesn't need to be removed from any chunk. If it had been, however, we do so now. if (this instanceof Player) { location.getChunk().removePlayer(asPlayer()); }