diff options
author | Holden Rohrer <hr@hrhr.dev> | 2021-09-01 11:41:46 -0400 |
---|---|---|
committer | Holden Rohrer <hr@hrhr.dev> | 2021-09-01 11:41:46 -0400 |
commit | d2aa5c6e5f9ba8a35730f929631407b4ce35f906 (patch) | |
tree | e7cb33d41393fae00db1402f113b4d962b00e37c | |
parent | 22a340479c17a6d3460b813179aee035a14e4ae2 (diff) |
fixed bug with loading portals after removing and replacing multiple times
-rw-r--r-- | source/portals.d | 4 |
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) { |