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()); }