diff --git a/gui/fsm.cpp b/gui/fsm.cpp index dbf9eb9..0eef3c3 100644 --- a/gui/fsm.cpp +++ b/gui/fsm.cpp @@ -24,7 +24,6 @@ namespace gui { $combat_ui($level), $status_ui($level), $map_ui($level), - $mini_map($level), $loot_ui($level), $font{FONT_FILE_NAME}, $dnd_loot($status_ui, $loot_ui, $window, $router) @@ -64,7 +63,6 @@ namespace gui { $map_ui.init(); $map_ui.log(L"Welcome to the game!"); - $mini_map.init($main_ui.$overlay_ui.$gui); run_systems(); @@ -405,8 +403,6 @@ namespace gui { if($map_open) { $map_ui.render($window, $main_ui.$compass_dir); - } else { - // $mini_map.render($window, $main_ui.$compass_dir); } } } @@ -552,7 +548,6 @@ namespace gui { $status_ui.update_level($level); $map_ui.update_level($level); - $mini_map.update_level($level); $combat_ui.update_level($level); $main_ui.update_level($level); $loot_ui.update_level($level); diff --git a/gui/fsm.hpp b/gui/fsm.hpp index 2e59d33..7bc3009 100644 --- a/gui/fsm.hpp +++ b/gui/fsm.hpp @@ -10,7 +10,6 @@ #include "gui/loot_ui.hpp" #include "gui/boss_fight_ui.hpp" #include "gui/map_view.hpp" -#include "gui/mini_map.hpp" #include "events.hpp" #include "gui/event_router.hpp" #include "gui/dnd_loot.hpp" @@ -44,7 +43,6 @@ namespace gui { CombatUI $combat_ui; StatusUI $status_ui; MapViewUI $map_ui; - MiniMapUI $mini_map; LootUI $loot_ui; sf::Font $font; gui::routing::Router $router; diff --git a/systems.cpp b/systems.cpp index 2ed3748..a8ef45f 100644 --- a/systems.cpp +++ b/systems.cpp @@ -24,6 +24,8 @@ using namespace DinkyECS; using lighting::LightSource; void System::set_position(World& world, SpatialMap& collision, Entity entity, Position pos) { + dbc::check(world.has(entity), "entity doesn't have tile"); + world.set(entity, pos); bool has_collision = world.has(entity); collision.insert(pos.location, entity, has_collision); @@ -146,14 +148,14 @@ void System::distribute_loot(GameLevel &level, Position target_pos) { if(inventory_count > 0) { auto pile = ritual::random_junk(config, inventory_count); - auto entity_data = config.devices["DEAD_BODY_LOOTABLE"]; + auto& entity_data = config.devices["DEAD_BODY_LOOTABLE"]; components::configure_entity(world, loot_entity, entity_data["components"]); world.set(loot_entity, pile); // BUG: inventory_count here isn't really used to remove it world.set(loot_entity, {inventory_count, entity_data}); } else { // this creates a dead body on the ground - auto entity_data = config.devices["DEAD_BODY"]; + auto& entity_data = config.devices["DEAD_BODY"]; components::configure_entity(world, loot_entity, entity_data["components"]); } @@ -309,7 +311,7 @@ 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); + // 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);