mirror of
https://github.com/Nimac0/SDL_Minigame
synced 2026-01-12 13:43:41 +00:00
fixed error detection in map
This commit is contained in:
parent
325da0eb4c
commit
3b18b05e78
@ -30,6 +30,7 @@ bool Map::loadMap(const char* path, int sizeX, int sizeY)
|
|||||||
continue;
|
continue;
|
||||||
Game::addTile(std::stoi(tileIDstr), x * TILE_SIZE, y * TILE_SIZE);
|
Game::addTile(std::stoi(tileIDstr), x * TILE_SIZE, y * TILE_SIZE);
|
||||||
tileIDstr.clear();
|
tileIDstr.clear();
|
||||||
|
x++;
|
||||||
if (singleChar == '\n') {
|
if (singleChar == '\n') {
|
||||||
if (x != sizeX) {
|
if (x != sizeX) {
|
||||||
SDL_SetError("Error loading map: specified x size doesn't match map file!");
|
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++;
|
y++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
x++;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!std::isdigit(singleChar)) continue;
|
if (!std::isdigit(singleChar)) continue;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user