From 7b1c39fbdf4778630758ee7087736072f2c66597 Mon Sep 17 00:00:00 2001 From: zegis Date: Sun, 27 Sep 2020 11:28:05 +0200 Subject: [PATCH] Entity manager will always return current map node for around key --- Kaeshi/Kaeshi.cs | 1 - Kaeshi/Modules/EntityManager.cs | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Kaeshi/Kaeshi.cs b/Kaeshi/Kaeshi.cs index b872234..1e09cd9 100644 --- a/Kaeshi/Kaeshi.cs +++ b/Kaeshi/Kaeshi.cs @@ -22,7 +22,6 @@ static void Main(string[] args) var entityManager = new EntityManager(); entityManager.AddVisibleObject("yourself", hero); - entityManager.AddVisibleObject("around", map.GetCurrentLocation()); var commandParser = new CommandParser(entityManager); diff --git a/Kaeshi/Modules/EntityManager.cs b/Kaeshi/Modules/EntityManager.cs index e10cb9a..04c3640 100644 --- a/Kaeshi/Modules/EntityManager.cs +++ b/Kaeshi/Modules/EntityManager.cs @@ -18,6 +18,10 @@ public void AddVisibleObject(string key, IVisible visibleObject) public IVisible GetVisibleObject(string key) { + if("around".Equals(key)) + { + level.GetCurrentLocation(); + } if (visibleObjects.TryGetValue(key, out var retVal)) return retVal;