diff --git a/systems.cpp b/systems.cpp index a8ef45f..2be7556 100644 --- a/systems.cpp +++ b/systems.cpp @@ -311,7 +311,6 @@ void System::collision(GameLevel &level) { void System::remove_from_world(GameLevel &level, Entity entity) { auto& item_pos = level.world->get(entity); level.collision->remove(item_pos.location, entity); - // level.world->remove(entity); // if you don't do this you get the bug that you can pickup // an item and it'll also be in your inventory level.world->remove(entity); diff --git a/textures.cpp b/textures.cpp index 7aac290..73af589 100644 --- a/textures.cpp +++ b/textures.cpp @@ -5,16 +5,20 @@ #include "config.hpp" #include "constants.hpp" #include +#include namespace textures { using std::shared_ptr, std::make_shared, nlohmann::json, std::string; + namespace fs = std::filesystem; static TextureManager TMGR; static bool initialized = false; void load_sprite_textures(SpriteTextureMap &mapping, json &config, bool smooth) { for(auto& [name, settings] : config.items()) { - auto texture = make_shared(settings["path"]); + const string& path = settings["path"]; + dbc::check(fs::exists(path), fmt::format("texture at {} doesn't exist", path)); + auto texture = make_shared(path); texture->setSmooth(smooth); auto sprite = make_shared(*texture);