diff options
author | orwell96 <orwell@bleipb.de> | 2018-06-14 22:25:54 +0200 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2018-06-14 22:25:54 +0200 |
commit | a961e7f672bf8befd0e460f863a5aa3dc7bacba5 (patch) | |
tree | f436f32b50cb28ea40e0c1bcff0e64a33509353e /advtrains/init.lua | |
parent | 6524c656a63ac6b34072411a7566bdd3712a1f91 (diff) | |
download | advtrains-a961e7f672bf8befd0e460f863a5aa3dc7bacba5.tar.gz advtrains-a961e7f672bf8befd0e460f863a5aa3dc7bacba5.tar.bz2 advtrains-a961e7f672bf8befd0e460f863a5aa3dc7bacba5.zip |
Fix box wagon inventory serialization and make box wagons protected.
Diffstat (limited to 'advtrains/init.lua')
-rw-r--r-- | advtrains/init.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/advtrains/init.lua b/advtrains/init.lua index 587dd12..482c33d 100644 --- a/advtrains/init.lua +++ b/advtrains/init.lua @@ -277,6 +277,15 @@ advtrains.avt_save = function(remove_players_from_wagons) end end + for id, wdata in pairs(advtrains.wagons) do + local _,proto = advtrains.get_wagon_prototype(wdata) + if proto.has_inventory then + local inv=minetest.get_inventory({type="detached", name="advtrains_wgn_"..id}) + wdata.ser_inv=advtrains.serialize_inventory(inv) + end + -- TODO apply save-keys here too + end + --versions: -- 1 - Initial new save format. local save_tbl={ |