1
0
Fork 0
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:
paramat 2015-10-13 05:17:33 +01:00
parent 2364449d7a
commit 3b9f99e0d6
5 changed files with 33 additions and 14 deletions

View file

@ -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);