From 5b7383cdf26079797318b7f7f03be2e893db2179 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Tue, 26 Nov 2019 23:40:30 -0500 Subject: [PATCH] Fix ai.aspects.avoid always returning an empty table --- src/ai/lua/lua_object.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ai/lua/lua_object.hpp b/src/ai/lua/lua_object.hpp index 9a80075c4132..bd5381c0b5f9 100644 --- a/src/ai/lua/lua_object.hpp +++ b/src/ai/lua/lua_object.hpp @@ -217,7 +217,7 @@ inline void lua_object::from_type(lua_State *L, std::shared_ptr< lua_createtable(L, locs.size(), 0); for(const map_location& loc : locs) { luaW_pushlocation(L, loc); - lua_rawseti(L, -1, lua_rawlen(L, -2) + 1); + lua_rawseti(L, -2, lua_rawlen(L, -2) + 1); } } else lua_pushnil(L); }