From 4cf9dc6f25e634327e10afebed8249d90f22b24a Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 13 Jun 2017 00:14:17 +0200 Subject: [PATCH] Fix boat staticdata --- mods/ITEMS/mcl_boats/init.lua | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/mods/ITEMS/mcl_boats/init.lua b/mods/ITEMS/mcl_boats/init.lua index 56b1e9c542..1085443da0 100644 --- a/mods/ITEMS/mcl_boats/init.lua +++ b/mods/ITEMS/mcl_boats/init.lua @@ -93,19 +93,22 @@ end function boat.on_activate(self, staticdata, dtime_s) self.object:set_armor_groups({immortal = 1}) - if type(staticdata) == "table" then - self.v = staticdata.v - self._itemstring = staticdata._itemstring + local data = minetest.deserialize(staticdata) + if type(data) == "table" then + self.v = data.v + self.last_v = self.v + self._itemstring = data.itemstring + self.object:set_properties({textures=data.textures}) end - self.last_v = self.v end function boat.get_staticdata(self) - return { + return minetest.serialize({ v = self.v, - _itemstring = self._itemstring, - } + itemstring = self._itemstring, + textures = self.object:get_properties().textures + }) end