mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-16 16:11:06 +01:00
Fix projectile tails clipping through sprite
This commit is contained in:
parent
16cc7e37d2
commit
58bee2a2dd
1 changed files with 4 additions and 3 deletions
|
@ -45,6 +45,7 @@ local math_floor = math.floor
|
|||
|
||||
-- localize vector functions
|
||||
local vector_new = vector.new
|
||||
local vector_add = vector.add
|
||||
local vector_length = vector.length
|
||||
local vector_direction = vector.direction
|
||||
local vector_normalize = vector.normalize
|
||||
|
@ -479,9 +480,7 @@ function mobs:register_arrow(name, def)
|
|||
if self.timer > 150
|
||||
or not mobs.within_limits(pos, 0) then
|
||||
mcl_burning.extinguish(self.object)
|
||||
print("removing 1")
|
||||
self.object:remove();
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -490,8 +489,10 @@ function mobs:register_arrow(name, def)
|
|||
and def.tail == 1
|
||||
and def.tail_texture then
|
||||
|
||||
--do this to prevent clipping through main entity sprite
|
||||
local new_pos = vector_add(pos, vector_multiply(vector_normalize(vel), -1))
|
||||
minetest.add_particle({
|
||||
pos = pos,
|
||||
pos = new_pos,
|
||||
velocity = {x = 0, y = 0, z = 0},
|
||||
acceleration = {x = 0, y = 0, z = 0},
|
||||
expirationtime = def.expire or 0.25,
|
||||
|
|
Loading…
Reference in a new issue