mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-01-12 19:10:26 +01:00
[snow] Update snowball throw mechanism from upstream
This commit is contained in:
parent
8322577bea
commit
7b8caf54ea
@ -118,15 +118,21 @@ function snow_snowball_ENTITY.on_step(self, dtime)
|
|||||||
|
|
||||||
if self.timer > 0.15 then
|
if self.timer > 0.15 then
|
||||||
for i, v in pairs(minetest.get_objects_inside_radius(self.object:getpos(), 1)) do
|
for i, v in pairs(minetest.get_objects_inside_radius(self.object:getpos(), 1)) do
|
||||||
if v:get_entity_name() ~= "snow:snowball_entity" and v:get_entity_name() ~= "__builtin:item"
|
if v ~= self.object then
|
||||||
and v:get_entity_name() ~= "gauges:hp_bar") then
|
local entity_name = v:get_entity_name()
|
||||||
v:punch(minetest.get_player_by_name(self.thrower), 1.0,{full_punch_interval=1.0, damage_groups = {fleshy=1} })
|
if v:get_entity_name() ~= "__builtin:item"
|
||||||
|
and entity_name ~= "snow:snowball_entity"
|
||||||
|
and entity_name ~= "gauges:hp_bar" then
|
||||||
|
if self.thrower then
|
||||||
|
v:punch(minetest.get_player_by_name(self.thrower), 1.0,{full_punch_interval=1.0, damage_groups = {fleshy=1}})
|
||||||
|
end
|
||||||
minetest.add_item(self.object:getpos(), "default:snow")
|
minetest.add_item(self.object:getpos(), "default:snow")
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
if self.physical then
|
if self.physical then
|
||||||
local fell = self.object:getvelocity().y == 0
|
local fell = self.object:getvelocity().y == 0
|
||||||
if not fell then
|
if not fell then
|
||||||
|
Loading…
Reference in New Issue
Block a user