Fix boat staticdata

This commit is contained in:
Wuzzy 2017-06-13 00:14:17 +02:00
parent 9e1d9abce9
commit 4cf9dc6f25

View file

@ -93,19 +93,22 @@ end
function boat.on_activate(self, staticdata, dtime_s) function boat.on_activate(self, staticdata, dtime_s)
self.object:set_armor_groups({immortal = 1}) self.object:set_armor_groups({immortal = 1})
if type(staticdata) == "table" then local data = minetest.deserialize(staticdata)
self.v = staticdata.v if type(data) == "table" then
self._itemstring = staticdata._itemstring self.v = data.v
self.last_v = self.v
self._itemstring = data.itemstring
self.object:set_properties({textures=data.textures})
end end
self.last_v = self.v
end end
function boat.get_staticdata(self) function boat.get_staticdata(self)
return { return minetest.serialize({
v = self.v, v = self.v,
_itemstring = self._itemstring, itemstring = self._itemstring,
} textures = self.object:get_properties().textures
})
end end