mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
ABMs: Make catch-up behaviour optional
Default is true for backwards compatibility Update lua_api.txt
This commit is contained in:
parent
2364449d7a
commit
3b9f99e0d6
5 changed files with 33 additions and 14 deletions
|
@ -143,8 +143,11 @@ void ScriptApiEnv::initializeEnvironment(ServerEnvironment *env)
|
|||
int trigger_chance = 50;
|
||||
getintfield(L, current_abm, "chance", trigger_chance);
|
||||
|
||||
LuaABM *abm = new LuaABM(L, id, trigger_contents,
|
||||
required_neighbors, trigger_interval, trigger_chance);
|
||||
bool simple_catch_up = true;
|
||||
getboolfield(L, current_abm, "catch_up", simple_catch_up);
|
||||
|
||||
LuaABM *abm = new LuaABM(L, id, trigger_contents, required_neighbors,
|
||||
trigger_interval, trigger_chance, simple_catch_up);
|
||||
|
||||
env->addActiveBlockModifier(abm);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue