1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-14 09:05:19 +02:00

Check for falling float nodes in liquid transform (#12862)

This commit is contained in:
Jude Melton-Houghton
2022-10-18 18:03:05 -04:00
committed by GitHub
parent b38ffdec27
commit dafdb3edb4
5 changed files with 35 additions and 1 deletions

View File

@@ -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<std::pair<v3s16, MapNode>> &list)
{

View File

@@ -43,6 +43,8 @@ public:
void on_emerge_area_completion(v3s16 blockpos, int action,
ScriptCallbackState *state);
void check_for_falling(v3s16 p);
// Called after liquid transform changes
void on_liquid_transformed(const std::vector<std::pair<v3s16, MapNode>> &list);