From: est31 Date: Thu, 3 Sep 2015 03:58:29 +0000 (+0200) Subject: Areastore: fix "attempt to index a number value" X-Git-Tag: 0.4.14~736 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2035bfc3a64e7c0c82f0cb100cd7d4cc588d0203;p=oweals%2Fminetest.git Areastore: fix "attempt to index a number value" Before, calling get_areas_in_area for an areastore with both include_borders and include_data would result in a lua error, if there was at least one area as result: attempt to index a number value in function 'get_areas_in_area' --- diff --git a/src/script/lua_api/l_areastore.cpp b/src/script/lua_api/l_areastore.cpp index 1e9075119..72fe24b20 100644 --- a/src/script/lua_api/l_areastore.cpp +++ b/src/script/lua_api/l_areastore.cpp @@ -45,6 +45,7 @@ static void push_area(lua_State *L, const Area *a, { if (!include_borders && !include_data) { lua_pushboolean(L, true); + return; } lua_newtable(L); if (include_borders) {