From 68d85c5eae9f56716d179283c58d15f4cd9753c1 Mon Sep 17 00:00:00 2001 From: Adrian Hedqvist Date: Wed, 10 Jan 2018 10:10:43 +0100 Subject: [PATCH] fixes --- src/Mapgen.cpp | 7 ++----- src/PlayState.cpp | 2 +- src/TileSet.cpp | 8 ++++---- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/Mapgen.cpp b/src/Mapgen.cpp index 2eacb40..24c9b0b 100644 --- a/src/Mapgen.cpp +++ b/src/Mapgen.cpp @@ -1,9 +1,5 @@ #include "Mapgen.h" -<<<<<<< HEAD #include "vec2i.h" -======= -#include "vec2i.h" ->>>>>>> 9557a88ed46a9e1e9aa3994762f9ec1dd7e051f1 #include #include #include @@ -255,7 +251,8 @@ Tilemap generate_dungeon(unsigned int seed, int width, int height, TileSet tiles // Find the room furthest away from the entrance and make it the exit Pathfinder::DijkstraMap dijk; const float maxv = width+height; - Pathfinder::calc_dijkstra_map(map, std::vector{ startpos }, dijk, maxv); + std::vector goals = { startpos }; + Pathfinder::calc_dijkstra_map(map, goals, dijk, maxv); float exitroomval = 0; Room* exitroom = &startroom; diff --git a/src/PlayState.cpp b/src/PlayState.cpp index 4d600aa..8a3476d 100644 --- a/src/PlayState.cpp +++ b/src/PlayState.cpp @@ -16,7 +16,7 @@ #include "Shaman.h" #include "Rng.h" #include "TileSet.h" -#include +#include InputAction player_action; TileSet tileset; diff --git a/src/TileSet.cpp b/src/TileSet.cpp index ddffb46..caf8891 100644 --- a/src/TileSet.cpp +++ b/src/TileSet.cpp @@ -1,6 +1,6 @@ #include "TileSet.h" -#include -#include +#include +#include Tile null = Tile(); @@ -67,7 +67,7 @@ void TileSet::load_from_table(kaguya::LuaStackRef table) { SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "Tileset: Missing value wall for tile: %s", key.c_str()); } SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "Tileset: Added tile: %s", key.c_str()); - tiles.insert_or_assign(key, t); + tiles[key] = t; if (tiles.count(key) == 0) { SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "Tileset: Could not find the tile we just added?!: %s", key.c_str()); } @@ -75,7 +75,7 @@ void TileSet::load_from_table(kaguya::LuaStackRef table) { } void TileSet::add_tile(std::string name, Tile tile) { - tiles.insert_or_assign(name, tile); + tiles[name] = tile; } Tile const& TileSet::get_tile(std::string name) {