From d2aa5c6e5f9ba8a35730f929631407b4ce35f906 Mon Sep 17 00:00:00 2001 From: Holden Rohrer Date: Wed, 1 Sep 2021 11:41:46 -0400 Subject: fixed bug with loading portals after removing and replacing multiple times --- source/portals.d | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/portals.d b/source/portals.d index 000e182..3c7f35a 100644 --- a/source/portals.d +++ b/source/portals.d @@ -122,7 +122,9 @@ class Portals { line.formattedRead!`%d @ %s`(id, portalText); _portals[id] = Portal(); _portals[id].fromString(portalText, _portals); - _nextId++; + _overlay[_portals[id].y, _portals[id].x] = Spot('/', id); + _nextId++; // works if the file is guaranteed to use + // linearly incrementing id's } int id; if (_nextId > 0) { -- cgit