From dafdb3edb4b65db144d72cd2274a657af671bdd1 Mon Sep 17 00:00:00 2001 From: Jude Melton-Houghton Date: Tue, 18 Oct 2022 18:03:05 -0400 Subject: Check for falling `float` nodes in liquid transform (#12862) --- src/script/cpp_api/s_env.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/script/cpp_api/s_env.cpp') diff --git a/src/script/cpp_api/s_env.cpp b/src/script/cpp_api/s_env.cpp index 55c0a84f5..e49113405 100644 --- a/src/script/cpp_api/s_env.cpp +++ b/src/script/cpp_api/s_env.cpp @@ -257,6 +257,18 @@ void ScriptApiEnv::on_emerge_area_completion( } } +void ScriptApiEnv::check_for_falling(v3s16 p) +{ + SCRIPTAPI_PRECHECKHEADER + + int error_handler = PUSH_ERROR_HANDLER(L); + lua_getglobal(L, "core"); + lua_getfield(L, -1, "check_for_falling"); + luaL_checktype(L, -1, LUA_TFUNCTION); + push_v3s16(L, p); + PCALL_RES(lua_pcall(L, 1, 0, error_handler)); +} + void ScriptApiEnv::on_liquid_transformed( const std::vector> &list) { -- cgit v1.2.3