Merge pull request 'Fix boat initialization failure' (#298) from c29979/MineClone5:fix-boat-init-failure into master

Reviewed-on: MineClone5/MineClone5#298
This commit is contained in:
kay27 2022-04-23 14:56:46 +00:00
commit d476e26c60
1 changed files with 6 additions and 4 deletions

View File

@ -166,11 +166,13 @@ function boat.on_activate(self, staticdata, dtime_s)
self._last_v = self._v
self._itemstring = data.itemstring
while #data.textures < 5 do
table.insert(data.textures, data.textures[1])
end
if data.textures then
while #data.textures < 5 do
table.insert(data.textures, data.textures[1])
end
self.object:set_properties({textures = data.textures})
self.object:set_properties({textures = data.textures})
end
end
end