aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_env.cpp
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2013-06-27 22:33:31 -0400
committerkwolekr <kwolekr@minetest.net>2013-06-27 22:35:35 -0400
commit9e100bc42b5275299020ea8619e64f2e4aa76192 (patch)
tree0fddf53b5665ec41181f52548a7676efa10e2e83 /src/script/lua_api/l_env.cpp
parent6b3169e4d0ebd82661d7cca9e3a381124a897f1a (diff)
downloadminetest-9e100bc42b5275299020ea8619e64f2e4aa76192.tar.gz
minetest-9e100bc42b5275299020ea8619e64f2e4aa76192.tar.bz2
minetest-9e100bc42b5275299020ea8619e64f2e4aa76192.zip
Apply various fixes to several things
Diffstat (limited to 'src/script/lua_api/l_env.cpp')
-rw-r--r--src/script/lua_api/l_env.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp
index 02cafc0d5..89ba9798a 100644
--- a/src/script/lua_api/l_env.cpp
+++ b/src/script/lua_api/l_env.cpp
@@ -579,6 +579,8 @@ int ModApiEnvMod::l_get_mapgen_object(lua_State *L)
EmergeManager *emerge = getServer(L)->getEmergeManager();
Mapgen *mg = emerge->getCurrentMapgen();
+ if (!mg)
+ return 0;
size_t maplen = mg->csize.X * mg->csize.Z;
@@ -614,7 +616,7 @@ int ModApiEnvMod::l_get_mapgen_object(lua_State *L)
}
break; }
case MGOBJ_BIOMEMAP: {
- if (!mg->heightmap)
+ if (!mg->biomemap)
return 0;
lua_newtable(L);
@@ -625,6 +627,9 @@ int ModApiEnvMod::l_get_mapgen_object(lua_State *L)
break; }
case MGOBJ_HEATMAP: { // Mapgen V7 specific objects
case MGOBJ_HUMIDMAP:
+ if (strcmp(emerge->params->mg_name.c_str(), "v7"))
+ return 0;
+
MapgenV7 *mgv7 = (MapgenV7 *)mg;
float *arr = (mgobj == MGOBJ_HEATMAP) ?