mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add blockseed to on_generated
This commit is contained in:
parent
81b9cfdfa4
commit
9a1df7bf38
6 changed files with 25 additions and 7 deletions
|
@ -4403,7 +4403,8 @@ void scriptapi_environment_step(lua_State *L, float dtime)
|
|||
}
|
||||
}
|
||||
|
||||
void scriptapi_environment_on_generated(lua_State *L, v3s16 minp, v3s16 maxp)
|
||||
void scriptapi_environment_on_generated(lua_State *L, v3s16 minp, v3s16 maxp,
|
||||
u32 blockseed)
|
||||
{
|
||||
realitycheck(L);
|
||||
assert(lua_checkstack(L, 20));
|
||||
|
@ -4423,7 +4424,8 @@ void scriptapi_environment_on_generated(lua_State *L, v3s16 minp, v3s16 maxp)
|
|||
// Call function
|
||||
push_v3s16(L, minp);
|
||||
push_v3s16(L, maxp);
|
||||
if(lua_pcall(L, 2, 0, 0))
|
||||
lua_pushnumber(L, blockseed);
|
||||
if(lua_pcall(L, 3, 0, 0))
|
||||
script_error(L, "error: %s", lua_tostring(L, -1));
|
||||
// value removed, keep key for next iteration
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue