diff options
author | paramat <mat.gregory@virginmedia.com> | 2015-10-13 05:17:33 +0100 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2015-10-18 16:42:59 +0100 |
commit | 3b9f99e0d61957c571ba857301d58ad29fb44527 (patch) | |
tree | e42aca267416df268d0e971b73c1db4a7e6358fe /src/script/cpp_api | |
parent | 2364449d7a173086c2681eae267b32e5c1596b00 (diff) | |
download | minetest-3b9f99e0d61957c571ba857301d58ad29fb44527.tar.gz minetest-3b9f99e0d61957c571ba857301d58ad29fb44527.tar.bz2 minetest-3b9f99e0d61957c571ba857301d58ad29fb44527.zip |
ABMs: Make catch-up behaviour optional
Default is true for backwards compatibility
Update lua_api.txt
Diffstat (limited to 'src/script/cpp_api')
-rw-r--r-- | src/script/cpp_api/s_env.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/script/cpp_api/s_env.cpp b/src/script/cpp_api/s_env.cpp index 9c733773a..b8717597a 100644 --- a/src/script/cpp_api/s_env.cpp +++ b/src/script/cpp_api/s_env.cpp @@ -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); |