aboutsummaryrefslogtreecommitdiff
path: root/source/portals.d
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2021-09-01 11:41:46 -0400
committerHolden Rohrer <hr@hrhr.dev>2021-09-01 11:41:46 -0400
commitd2aa5c6e5f9ba8a35730f929631407b4ce35f906 (patch)
treee7cb33d41393fae00db1402f113b4d962b00e37c /source/portals.d
parent22a340479c17a6d3460b813179aee035a14e4ae2 (diff)
fixed bug with loading portals after removing and replacing multiple times
Diffstat (limited to 'source/portals.d')
-rw-r--r--source/portals.d4
1 files changed, 3 insertions, 1 deletions
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) {