diff options
author | sfan5 <sfan5@live.de> | 2022-12-04 12:35:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-04 12:35:14 +0100 |
commit | 37386b9c3cfc6746734f8c00fa99a44a63b8aeed (patch) | |
tree | 9baec3820a02044290eee400db4bcd2f2ddb674f /src/script/lua_api/l_env.cpp | |
parent | aa3505a9e4523c2a8bec5ca6368b3bc2068185ef (diff) | |
download | minetest-37386b9c3cfc6746734f8c00fa99a44a63b8aeed.tar.xz |
Expose dtime_s to LBM handler
Diffstat (limited to 'src/script/lua_api/l_env.cpp')
-rw-r--r-- | src/script/lua_api/l_env.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp index 642101166..45d444d55 100644 --- a/src/script/lua_api/l_env.cpp +++ b/src/script/lua_api/l_env.cpp @@ -109,7 +109,8 @@ void LuaABM::trigger(ServerEnvironment *env, v3s16 p, MapNode n, lua_pop(L, 1); // Pop error handler } -void LuaLBM::trigger(ServerEnvironment *env, v3s16 p, MapNode n) +void LuaLBM::trigger(ServerEnvironment *env, v3s16 p, + const MapNode n, const float dtime_s) { ServerScripting *scriptIface = env->getScriptIface(); scriptIface->realityCheck(); @@ -141,8 +142,9 @@ void LuaLBM::trigger(ServerEnvironment *env, v3s16 p, MapNode n) lua_remove(L, -2); // Remove registered_lbms[m_id] push_v3s16(L, p); pushnode(L, n); + lua_pushnumber(L, dtime_s); - int result = lua_pcall(L, 2, 0, error_handler); + int result = lua_pcall(L, 3, 0, error_handler); if (result) scriptIface->scriptError(result, "LuaLBM::trigger"); |