summaryrefslogtreecommitdiffstats
path: root/src/model/Map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/Map.cpp')
-rw-r--r--src/model/Map.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/model/Map.cpp b/src/model/Map.cpp
index 21fbe00..faead6d 100644
--- a/src/model/Map.cpp
+++ b/src/model/Map.cpp
@@ -39,10 +39,13 @@ std::unique_ptr<Map> Map::load(__attribute__((unused)) const std::string &name)
for (int i = 0; i < 16; i++) {
for (int j = 0; j < 16; j++) {
- if (4 <= i && i < 12 && 4 <= j && j < 12)
+ if (4 <= i && i < 12 && 4 <= j && j < 12) {
map->setTileAt(0, i, j, 1);
- else
+ map->setCollisionAt(i, j, EMPTY);
+ }
+ else {
map->setTileAt(0, i, j, 0);
+ }
if (4 <= i && i < 12 && j == 8)
map->setTileAt(1, i, j, 2);
@@ -52,7 +55,7 @@ std::unique_ptr<Map> Map::load(__attribute__((unused)) const std::string &name)
}
map->entities.emplace_back("square");
- map->entities.back().moveTo(Model::Position{6, 6});
+ map->entities.back().moveTo(map.get(), Model::Position{6, 6});
return map;
}