reset map before update, not optimale but ok for now

This commit is contained in:
Bluub
2021-06-19 16:17:02 +02:00
parent 4d4c8df243
commit 28916bde0a
@@ -27,6 +27,9 @@ namespace BBM
} }
if (_cached) if (_cached)
return; return;
for (int i = 0; i < 17; i++)
for (int j = 0; j < 17; j++)
_luamap._map[i][j] = 0;
for (auto &[other, pos, _] : _wal.getScene()->view<PositionComponent, TagComponent<Breakable>>()) for (auto &[other, pos, _] : _wal.getScene()->view<PositionComponent, TagComponent<Breakable>>())
_luamap._map[pos.position.z][pos.position.x] = MapGenerator::BREAKABLE; _luamap._map[pos.position.z][pos.position.x] = MapGenerator::BREAKABLE;
for (auto &[other, pos, _] : _wal.getScene()->view<PositionComponent, TagComponent<Unbreakable>>()) for (auto &[other, pos, _] : _wal.getScene()->view<PositionComponent, TagComponent<Unbreakable>>())