aboutsummaryrefslogtreecommitdiff
path: root/advtrains
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-07-17 21:15:34 +0200
committerorwell96 <orwell@bleipb.de>2018-08-12 17:56:02 +0200
commitb80ba056d9ba993109ceae11eac403139afec39f (patch)
treeacee65ed6fac8a18716b31406e1056dfe7d4f5ac /advtrains
parent6d7d9d018161c5e14cfa0992bc3361e5df071c6f (diff)
downloadadvtrains-b80ba056d9ba993109ceae11eac403139afec39f.tar.gz
advtrains-b80ba056d9ba993109ceae11eac403139afec39f.tar.bz2
advtrains-b80ba056d9ba993109ceae11eac403139afec39f.zip
Fix some incompatibility crash for old worlds
Diffstat (limited to 'advtrains')
-rw-r--r--advtrains/trainlogic.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua
index 7cd1c1d..c032937 100644
--- a/advtrains/trainlogic.lua
+++ b/advtrains/trainlogic.lua
@@ -691,12 +691,12 @@ function advtrains.update_trainpart_properties(train_id, invert_flipstate)
-- 1st: update wagon data (pos_in_train a.s.o)
if data then
- local wagon = advtrains.wagon_prototypes[data.type]
+ local wagon = advtrains.wagon_prototypes[data.type or data.entity_name]
if not wagon then
atwarn("Wagon '",data.type,"' couldn't be found. Please check that all required modules are loaded!")
wagon = advtrains.wagon_prototypes["advtrains:wagon_placeholder"]
+
end
-
rel_pos=rel_pos+wagon.wagon_span
data.train_id=train_id
data.pos_in_train=rel_pos