aboutsummaryrefslogtreecommitdiff
path: root/advtrains
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2017-10-11 11:53:14 +0200
committerorwell96 <orwell@bleipb.de>2017-10-11 11:53:14 +0200
commit0dfb0fce22147f67d17d599fa143ac5ce131db4f (patch)
tree5ad34721b0311a0d3217f8e77cee23b281013d2e /advtrains
parentb6a5620cd323768c188d01d80432a8994927ea93 (diff)
downloadadvtrains-0dfb0fce22147f67d17d599fa143ac5ce131db4f.tar.gz
advtrains-0dfb0fce22147f67d17d599fa143ac5ce131db4f.tar.bz2
advtrains-0dfb0fce22147f67d17d599fa143ac5ce131db4f.zip
Do not crash when train_pos is nil while checking wagon entity loading
Diffstat (limited to 'advtrains')
-rw-r--r--advtrains/trainlogic.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua
index 483ea52..d8130e9 100644
--- a/advtrains/trainlogic.lua
+++ b/advtrains/trainlogic.lua
@@ -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)