diff --git a/advtrains.zip b/advtrains.zip index b1e88d5..38995c6 100644 Binary files a/advtrains.zip and b/advtrains.zip differ diff --git a/trainlogic.lua b/trainlogic.lua index 0291e8f..f16e1e2 100644 --- a/trainlogic.lua +++ b/trainlogic.lua @@ -246,11 +246,12 @@ function advtrains.train_step(id, train, dtime) --check for any trainpart entities if they have been unloaded. do this only if train is near a player, to not spawn entities into unloaded areas train.check_trainpartload=(train.check_trainpartload or 0)-dtime local node_range=(math.max((minetest.setting_get("active_block_range") or 0),1)*16) - if train.check_trainpartload<=0 and posfront and posback then - --print(minetest.pos_to_string(posfront)) + if train.check_trainpartload<=0 then + local ori_pos=advtrains.get_real_index_position(path, train.index) --not much to calculate + local should_check=false for _,p in ipairs(minetest.get_connected_players()) do - should_check=should_check or ((vector.distance(posfront, p:getpos())