On_Joinplayer: fix train ID check for attachment update
Previously, statement was always false because train_id is no longer in the luaentitymaster
parent
744aee2cdd
commit
2b21817b4f
|
@ -143,8 +143,11 @@ minetest.register_on_joinplayer(function(player)
|
||||||
local id=advtrains.player_to_train_mapping[pname]
|
local id=advtrains.player_to_train_mapping[pname]
|
||||||
if id then
|
if id then
|
||||||
for _,wagon in pairs(minetest.luaentities) do
|
for _,wagon in pairs(minetest.luaentities) do
|
||||||
if wagon.is_wagon and wagon.initialized and wagon.train_id==id then
|
if wagon.is_wagon and wagon.initialized and wagon.id then
|
||||||
wagon:reattach_all()
|
local wdata = advtrains.wagons[wagon.id]
|
||||||
|
if wdata and wdata.train_id == id then
|
||||||
|
wagon:reattach_all()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue