actually fix instancing issue

This commit is contained in:
Sumyjkl 2022-08-12 19:13:53 +10:00
parent 4aa98185f8
commit 49c53b06a7

View file

@ -308,6 +308,20 @@ function boat.on_activate(self, staticdata, dtime_s)
self.object:set_properties({textures = data.textures})
end
self._sounds = { -- workaround for copy vs reference issue
engine = {
handle = nil,
gain = 0.1,
playing = false,
time_elapsed = 0,
},
engine_stop = {
handle = nil,
gain = 0.1,
playing = false,
time_elapsed = 0,
},
}
end
function boat.get_staticdata(self)
@ -606,21 +620,6 @@ for b=1, #boat_ids do
end
local boat = minetest.add_entity(pos, "sum_airship:boat")
local texture = "sum_airship_texture_"..images[b].."_boat.png"
local luaent = boat:get_luaentity()
luaent._sounds = { -- workaround for copy vs reference issue
engine = {
handle = nil,
gain = 0.1,
playing = false,
time_elapsed = 0,
},
engine_stop = {
handle = nil,
gain = 0.1,
playing = false,
time_elapsed = 0,
},
}
boat:get_luaentity()._itemstring = itemstring
boat:set_properties({textures = { texture, texture, texture, texture, texture }})
boat:set_yaw(placer:get_look_horizontal())