aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_mapgen.cpp
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-05-28 20:04:40 -0400
committerkwolekr <kwolekr@minetest.net>2015-05-28 20:04:50 -0400
commit522acf920fbeb034b1636df68a3db282bf823d00 (patch)
tree1e7be57239f0a690a3e7812ed0ab7aba5ad00d02 /src/script/lua_api/l_mapgen.cpp
parent0f15488eae058bfb2143f837b179a6631286192c (diff)
downloadminetest-522acf920fbeb034b1636df68a3db282bf823d00.tar.gz
minetest-522acf920fbeb034b1636df68a3db282bf823d00.tar.bz2
minetest-522acf920fbeb034b1636df68a3db282bf823d00.zip
Make get_biome_list() error message more helpful
Diffstat (limited to 'src/script/lua_api/l_mapgen.cpp')
-rw-r--r--src/script/lua_api/l_mapgen.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp
index 57090a58f..1a462adf7 100644
--- a/src/script/lua_api/l_mapgen.cpp
+++ b/src/script/lua_api/l_mapgen.cpp
@@ -416,7 +416,9 @@ size_t get_biome_list(lua_State *L, int index,
if (is_single) {
Biome *biome = get_or_load_biome(L, index, biomemgr);
if (!biome) {
- errorstream << "get_biome_list: failed to get biome" << std::endl;
+ errorstream << "get_biome_list: failed to get biome '"
+ << (lua_isstring(L, index) ? lua_tostring(L, index) : "")
+ << "'." << std::endl;
return 1;
}
@@ -433,8 +435,9 @@ size_t get_biome_list(lua_State *L, int index,
Biome *biome = get_or_load_biome(L, -1, biomemgr);
if (!biome) {
fail_count++;
- errorstream << "get_biome_list: failed to load biome (index "
- << count << ")" << std::endl;
+ errorstream << "get_biome_list: failed to get biome '"
+ << (lua_isstring(L, -1) ? lua_tostring(L, -1) : "")
+ << "'" << std::endl;
continue;
}