summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp index ffa52cf..dbd314a 100644 --- a/src/game.cpp +++ b/src/game.cpp
@@ -52,6 +52,8 @@ void Game::loadMap(std::string filename) {
52 map_ = std::make_unique<Map>(filename); 52 map_ = std::make_unique<Map>(filename);
53 53
54 for (const Prototype& p : map_->getPrototypes()) { 54 for (const Prototype& p : map_->getPrototypes()) {
55 if (spritesByAlias_.count(p.name)) continue;
56
55 int spriteId = emplaceSprite(p.name); 57 int spriteId = emplaceSprite(p.name);
56 getSystem<TransformSystem>().initSprite(spriteId, p.pos); 58 getSystem<TransformSystem>().initSprite(spriteId, p.pos);
57 getSystem<TransformSystem>().setUpCollision(spriteId, p.collisionOffset, p.collisionSize, true); 59 getSystem<TransformSystem>().setUpCollision(spriteId, p.collisionOffset, p.collisionSize, true);
@@ -63,6 +65,8 @@ void Game::loadMap(std::string filename) {
63 } 65 }
64 66
65 for (const Trigger& t : map_->getTriggers()) { 67 for (const Trigger& t : map_->getTriggers()) {
68 if (spritesByAlias_.count(t.name)) continue;
69
66 int spriteId = emplaceSprite(t.name); 70 int spriteId = emplaceSprite(t.name);
67 getSystem<TransformSystem>().initSprite(spriteId, t.pos); 71 getSystem<TransformSystem>().initSprite(spriteId, t.pos);
68 getSystem<TransformSystem>().setUpCollision(spriteId, {0, 0}, t.size, false); 72 getSystem<TransformSystem>().setUpCollision(spriteId, {0, 0}, t.size, false);