aboutsummaryrefslogtreecommitdiff
path: root/advtrains/init.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2020-07-12 20:37:51 +0200
committerorwell96 <orwell@bleipb.de>2020-07-12 20:37:51 +0200
commit19509acf56aef4b6e5f45023ee5603e95822fe69 (patch)
tree7cd79532ce7a6ab6a53d7917fc28a42a686a6afc /advtrains/init.lua
parent74bf177cc850164a0a6c13a634e7da6410f9f73a (diff)
downloadadvtrains-19509acf56aef4b6e5f45023ee5603e95822fe69.tar.gz
advtrains-19509acf56aef4b6e5f45023ee5603e95822fe69.tar.bz2
advtrains-19509acf56aef4b6e5f45023ee5603e95822fe69.zip
Add workaround to unload wagons that are too far away from players
Diffstat (limited to 'advtrains/init.lua')
-rw-r--r--advtrains/init.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/advtrains/init.lua b/advtrains/init.lua
index 28e104e..84cfa38 100644
--- a/advtrains/init.lua
+++ b/advtrains/init.lua
@@ -39,6 +39,12 @@ AT_CMAX = 16
advtrains = {trains={}, player_to_train_mapping={}}
+-- get wagon loading range
+advtrains.wagon_load_range = tonumber(minetest.settings:get("advtrains_wagon_load_range"))
+if not advtrains.wagon_load_range then
+ advtrains.wagon_load_range = tonumber(minetest.settings:get("active_block_range"))*16
+end
+
--pcall
local no_action=false