From 87727e9fbe5c86d5a161e953980197f3ebdbd2c7 Mon Sep 17 00:00:00 2001 From: alyokhin Date: Tue, 21 Jun 2022 14:45:07 +0300 Subject: [PATCH] Swap to strict checker for lua stings --- src/map/script_tileset.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/map/script_tileset.cpp b/src/map/script_tileset.cpp index b2c786c41..ddb7bb5f0 100644 --- a/src/map/script_tileset.cpp +++ b/src/map/script_tileset.cpp @@ -134,7 +134,7 @@ tile_flags CTileset::parseTilesetTileFlags(lua_State *l, int *j) // Parse the list: flags of the slot while (1) { lua_rawgeti(l, -1, *j + 1); - if (!lua_isstring(l, -1)) { + if (!lua_isstring_strict(l, -1)) { lua_pop(l, 1); break; } @@ -733,7 +733,7 @@ uint16_t CTilesetGraphicGenerator::checkForLayers(lua_State *luaStack) const if (lua_istable(luaStack, -1)) { lua_rawgeti(luaStack, -1, 1); /// #1< - isMultipleLayers = lua_isstring(luaStack, -1) && std::string(LuaToString(luaStack, -1)) == "layers"; + isMultipleLayers = lua_isstring_strict(luaStack, -1) && std::string(LuaToString(luaStack, -1)) == "layers"; lua_pop(luaStack, 1); /// #1> } else if (!lua_isnumber(luaStack, -1)) { @@ -765,7 +765,7 @@ std::vector CTilesetGraphicGenerator::parseSrcRange(lua_State *luaSt lua_rawgeti(luaStack, -1, 1); /// #1< /// check if "img" tag is present - if (lua_isstring(luaStack, -1)) { + if (lua_isstring_strict(luaStack, -1)) { const std::string parsedValue { LuaToString(luaStack, -1) }; if (parsedValue == "img") { isImg = true; @@ -1397,7 +1397,7 @@ std::vector CTilesetParser::parseTilesRange(lua_State *luaStack, con resultSet.push_back(LuaToUnsignedNumber(luaStack, -1, arg)); } - } else if (lua_isstring(luaStack, -1)) { + } else if (lua_isstring_strict(luaStack, -1)) { lua_pop(luaStack, 1); int arg = parseFromPos;