aboutsummaryrefslogtreecommitdiff
path: root/advtrains/trainlogic.lua
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2025-01-09 00:57:32 +0100
committerorwell <orwell@bleipb.de>2025-01-09 08:38:09 +0100
commit8c91ce1ec178d6d49f3ddefc57d99eecd0caef3c (patch)
treec5915919c6efe856207d136404846f6ed86670ae /advtrains/trainlogic.lua
parent9bd34f738663cdc268db6399ecb6aaba2d4c9a28 (diff)
downloadadvtrains-8c91ce1ec178d6d49f3ddefc57d99eecd0caef3c.tar.gz
advtrains-8c91ce1ec178d6d49f3ddefc57d99eecd0caef3c.tar.bz2
advtrains-8c91ce1ec178d6d49f3ddefc57d99eecd0caef3c.zip
Various bugfixes found in lunixforks debug
Diffstat (limited to 'advtrains/trainlogic.lua')
-rw-r--r--advtrains/trainlogic.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua
index e4939df..0e588c7 100644
--- a/advtrains/trainlogic.lua
+++ b/advtrains/trainlogic.lua
@@ -630,7 +630,7 @@ function advtrains.train_step_b(id, train, dtime)
local ocn = otrn.path_cn[ob_idx]
local ocp = otrn.path_cp[ob_idx]
- local target_is_inside, ref_index, facing
+ local target_is_inside, ref_index, facing, same_dir
if base_cn == ocn then
-- same direction
@@ -1049,7 +1049,7 @@ function advtrains.update_trainpart_properties(train_id, invert_flipstate)
if not wagon then
local ent = advtrains.wagon_objects[w_id]
local pdesc
- if ent then
+ if ent and ent:get_pos() then
pdesc = "at " .. minetest.pos_to_string(ent:get_pos())
elseif train.last_pos then
pdesc = "near " .. minetest.pos_to_string(train.last_pos)