Do not crash when train_pos is nil while checking wagon entity loading

master
orwell96 2017-10-11 11:53:14 +02:00
parent b6a5620cd3
commit 0dfb0fce22
1 changed files with 1 additions and 1 deletions

View File

@ -470,7 +470,7 @@ function advtrains.train_step_a(id, train, dtime)
local should_check=false
for _,p in ipairs(minetest.get_connected_players()) do
should_check=should_check or ((vector.distance(ori_pos, p:getpos())<node_range))
should_check=should_check or (ori_pos and ((vector.distance(ori_pos, p:getpos())<node_range)))
end
if should_check then
advtrains.update_trainpart_properties(id)