1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-11-06 17:35:14 -05:00

Make get_biome_list() error message more helpful

This commit is contained in:
kwolekr 2015-05-28 20:04:40 -04:00
parent 0f15488eae
commit 522acf920f

View File

@ -416,7 +416,9 @@ size_t get_biome_list(lua_State *L, int index,
if (is_single) { if (is_single) {
Biome *biome = get_or_load_biome(L, index, biomemgr); Biome *biome = get_or_load_biome(L, index, biomemgr);
if (!biome) { 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; 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); Biome *biome = get_or_load_biome(L, -1, biomemgr);
if (!biome) { if (!biome) {
fail_count++; fail_count++;
errorstream << "get_biome_list: failed to load biome (index " errorstream << "get_biome_list: failed to get biome '"
<< count << ")" << std::endl; << (lua_isstring(L, -1) ? lua_tostring(L, -1) : "")
<< "'" << std::endl;
continue; continue;
} }