diff options
author | orwell <orwell@bleipb.de> | 2025-01-09 00:57:32 +0100 |
---|---|---|
committer | orwell <orwell@bleipb.de> | 2025-01-09 08:38:09 +0100 |
commit | 8c91ce1ec178d6d49f3ddefc57d99eecd0caef3c (patch) | |
tree | c5915919c6efe856207d136404846f6ed86670ae /advtrains | |
parent | 9bd34f738663cdc268db6399ecb6aaba2d4c9a28 (diff) | |
download | advtrains-8c91ce1ec178d6d49f3ddefc57d99eecd0caef3c.tar.gz advtrains-8c91ce1ec178d6d49f3ddefc57d99eecd0caef3c.tar.bz2 advtrains-8c91ce1ec178d6d49f3ddefc57d99eecd0caef3c.zip |
Various bugfixes found in lunixforks debug
Diffstat (limited to 'advtrains')
-rw-r--r-- | advtrains/occupation.lua | 4 | ||||
-rw-r--r-- | advtrains/trainlogic.lua | 4 | ||||
-rw-r--r-- | advtrains/wagons.lua | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/advtrains/occupation.lua b/advtrains/occupation.lua index 26e1f79..20a986e 100644 --- a/advtrains/occupation.lua +++ b/advtrains/occupation.lua @@ -89,8 +89,8 @@ function o.set_item(train_id, pos, idx) assert(idx) local i = 1 while t[i] do - if t[i]==train_id and t[i+1]==index then - break + if t[i]==train_id and t[i+1]==idx then + return end i = i + 2 end 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) diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua index ef057e5..01c60ec 100644 --- a/advtrains/wagons.lua +++ b/advtrains/wagons.lua @@ -1333,7 +1333,7 @@ function advtrains.get_wagon_prototype(data) end local rt, proto = advtrains.resolve_wagon_alias(wt) if not rt then - atwarn("Unable to load wagon type",wt,", using placeholder") + --atwarn("Unable to load wagon type",wt,", using placeholder") rt = "advtrains:wagon_placeholder" proto = advtrains.wagon_prototypes[rt] end |