|
|
@ -487,7 +487,7 @@ std::shared_ptr<sf::Shader> System::sprite_effect(GameLevel &level, Entity entit |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Entity System::spawn_item(World& world, const std::string& name) { |
|
|
|
Entity System::spawn_item(World& world, const std::string& name) { |
|
|
|
Config config("assets/items.json"); |
|
|
|
auto& config = world.get_the<GameConfig>().items; |
|
|
|
auto& item_config = config[name]; |
|
|
|
auto& item_config = config[name]; |
|
|
|
auto item_id = world.entity(); |
|
|
|
auto item_id = world.entity(); |
|
|
|
world.set<InventoryItem>(item_id, {1, item_config}); |
|
|
|
world.set<InventoryItem>(item_id, {1, item_config}); |
|
|
|