use air currents for smoke

This commit is contained in:
Sumyjkl 2022-08-09 13:56:28 +10:00
parent de71343291
commit 8bbae029e5

View file

@ -348,8 +348,12 @@ function boat.on_step(self, dtime, moveresult)
vel = {x=0, y=-0.6, z=0}
end
if has_air_currents and (self._driver or not is_on_floor) then
vel = sum_air_currents.apply_wind(vel, p)
local wind_vel = vector.new(0,0,0)
if has_air_currents then
wind_vel = sum_air_currents.get_wind(p)
if self._driver or not is_on_floor then
vel = vector.add(wind_vel, vel)
end
end
local v = self.object:get_velocity()
@ -379,7 +383,7 @@ function boat.on_step(self, dtime, moveresult)
local spread = 0.06
minetest.add_particle({
pos = vector.offset(chimney_pos, math.random(-1, 1)*spread, 0, math.random(-1, 1)*spread),
velocity = {x=0, y=math.random(0.2*100,0.7*100)/100, z=0},
velocity = vector.add(wind_vel, {x=0, y=math.random(0.2*100,0.7*100)/100, z=0}),
expirationtime = math.random(0.5, 2),
size = math.random(0.1, 4),
collisiondetection = false,