From d0e81a313f05032cced2ce7b0e0c0dc3535f214e Mon Sep 17 00:00:00 2001 From: DenisD3D Date: Thu, 14 Mar 2024 12:01:26 +0100 Subject: [PATCH] Add map default_tile attribute --- src/map.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/map.cpp b/src/map.cpp index ec94abe..cb75b1d 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -124,6 +124,11 @@ Map::Map(const QFileInfo &file) { // Get map tiles tiles = new TileType[width * height]; + if (root.hasAttribute("default_tile")) { + std::fill_n(tiles, width * height, types[root.attribute("default_tile")]); + } else { + std::fill_n(tiles, width * height, types["ground"]); + } const QDomNodeList map_tiles = root.elementsByTagName("tile"); for (int i = 0; i < map_tiles.size(); i++) { QDomElement tile = map_tiles.at(i).toElement();