diff options
author | Kahrl <kahrl@gmx.net> | 2013-08-11 04:09:45 +0200 |
---|---|---|
committer | Kahrl <kahrl@gmx.net> | 2013-08-14 21:03:33 +0200 |
commit | 4e1f50035e860a00636ca5d804c267119df99601 (patch) | |
tree | c6cab522305ef2a5b9cfdb3685340d57590f1ff1 /src/script/cpp_api/s_env.cpp | |
parent | 6228d634fb31d1ce925d1fdc2dac022629a007ef (diff) | |
download | minetest-4e1f50035e860a00636ca5d804c267119df99601.tar.gz minetest-4e1f50035e860a00636ca5d804c267119df99601.tar.bz2 minetest-4e1f50035e860a00636ca5d804c267119df99601.zip |
Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenu
Diffstat (limited to 'src/script/cpp_api/s_env.cpp')
-rw-r--r-- | src/script/cpp_api/s_env.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/script/cpp_api/s_env.cpp b/src/script/cpp_api/s_env.cpp index 632b28f45..ef3a1dddf 100644 --- a/src/script/cpp_api/s_env.cpp +++ b/src/script/cpp_api/s_env.cpp @@ -18,16 +18,13 @@ with this program; if not, write to the Free Software Foundation, Inc., */ #include "cpp_api/s_env.h" +#include "cpp_api/s_internal.h" #include "common/c_converter.h" #include "log.h" #include "environment.h" #include "mapgen.h" #include "lua_api/l_env.h" -extern "C" { -#include "lauxlib.h" -} - void ScriptApiEnv::environment_OnGenerated(v3s16 minp, v3s16 maxp, u32 blockseed) { @@ -40,7 +37,7 @@ void ScriptApiEnv::environment_OnGenerated(v3s16 minp, v3s16 maxp, push_v3s16(L, minp); push_v3s16(L, maxp); lua_pushnumber(L, blockseed); - runCallbacks(3, RUN_CALLBACKS_MODE_FIRST); + script_run_callbacks(L, 3, RUN_CALLBACKS_MODE_FIRST); } void ScriptApiEnv::environment_Step(float dtime) @@ -53,7 +50,7 @@ void ScriptApiEnv::environment_Step(float dtime) lua_getfield(L, -1, "registered_globalsteps"); // Call callbacks lua_pushnumber(L, dtime); - runCallbacks(1, RUN_CALLBACKS_MODE_FIRST); + script_run_callbacks(L, 1, RUN_CALLBACKS_MODE_FIRST); } void ScriptApiEnv::environment_OnMapgenInit(MapgenParams *mgparams) @@ -80,7 +77,7 @@ void ScriptApiEnv::environment_OnMapgenInit(MapgenParams *mgparams) lua_pushstring(L, flagstr.c_str()); lua_setfield(L, -2, "flags"); - runCallbacks(1, RUN_CALLBACKS_MODE_FIRST); + script_run_callbacks(L, 1, RUN_CALLBACKS_MODE_FIRST); } void ScriptApiEnv::initializeEnvironment(ServerEnvironment *env) |