From 3b18b05e7835a803a47c34837fd69511e161e14c Mon Sep 17 00:00:00 2001 From: Benedikt Galbavy Date: Tue, 30 Jan 2024 16:13:48 +0100 Subject: [PATCH] fixed error detection in map --- src/Map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Map.cpp b/src/Map.cpp index 30222f5..7f65563 100644 --- a/src/Map.cpp +++ b/src/Map.cpp @@ -30,6 +30,7 @@ bool Map::loadMap(const char* path, int sizeX, int sizeY) continue; Game::addTile(std::stoi(tileIDstr), x * TILE_SIZE, y * TILE_SIZE); tileIDstr.clear(); + x++; if (singleChar == '\n') { if (x != sizeX) { SDL_SetError("Error loading map: specified x size doesn't match map file!"); @@ -39,7 +40,6 @@ bool Map::loadMap(const char* path, int sizeX, int sizeY) y++; continue; } - x++; continue; } if (!std::isdigit(singleChar)) continue;