mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2025-01-01 14:17:29 +01:00
Improve firework direction correction math
...to allow shooting them from narrow tunnels
This commit is contained in:
parent
4254b9311c
commit
67592d13ee
@ -56,6 +56,9 @@ local firework_entity = {
|
||||
self._vl_projectile.extra = nil
|
||||
end
|
||||
if not self._dir then return end
|
||||
if self._last_pos and (self._last_pos - self.object:get_pos()):length() < (10*dtime) then
|
||||
self._rot_axis = -self._rot_axis
|
||||
end
|
||||
self._dir = self._dir:rotate_around_axis(self._rot_axis, dtime/3)
|
||||
local obj = self.object
|
||||
obj:set_velocity((obj:get_velocity():length() + self._force*dtime) * self._dir)
|
||||
|
Loading…
Reference in New Issue
Block a user