From 21a54e4bd01099e5892a2cfda14f3513dd6e768a Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Wed, 23 Jun 2021 09:47:14 -0400 Subject: [PATCH] Fix shroud parsing functions Addresses #5885 --- src/scripting/game_lua_kernel.cpp | 2 +- src/scripting/lua_common.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripting/game_lua_kernel.cpp b/src/scripting/game_lua_kernel.cpp index 42108c495b1..bf6719dc648 100644 --- a/src/scripting/game_lua_kernel.cpp +++ b/src/scripting/game_lua_kernel.cpp @@ -790,7 +790,7 @@ static int intf_parse_shroud_bitmap(lua_State* L) std::set locs; for(int x = 1; x <= temp.width(); x++) { for(int y = 1; y <= temp.height(); y++) { - if(temp.value(x, y)) { + if(!temp.value(x, y)) { locs.emplace(x, y, wml_loc()); } } diff --git a/src/scripting/lua_common.cpp b/src/scripting/lua_common.cpp index eec4e092ed6..9066ba3f508 100644 --- a/src/scripting/lua_common.cpp +++ b/src/scripting/lua_common.cpp @@ -754,7 +754,7 @@ std::set luaW_check_locationset(lua_State* L, int idx) } lua_len(L, idx); int len = luaL_checkinteger(L, -1); - for(int i = 1; i < len; i++) { + for(int i = 1; i <= len; i++) { lua_geti(L, idx, i); locs.insert(luaW_checklocation(L, -1)); lua_pop(L, 1);