forked from VoxeLibre/VoxeLibre
Allow passive mobs to have protectors
This commit is contained in:
parent
3697ef8069
commit
1536338199
|
@ -746,7 +746,7 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
|
|||
|
||||
local name = hitter:get_player_name() or ""
|
||||
|
||||
-- attack puncher and call other mobs for help
|
||||
-- attack puncher
|
||||
if self.passive == false
|
||||
and self.state ~= "flop"
|
||||
and (self.child == false or self.type == "monster")
|
||||
|
@ -758,6 +758,7 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
|
|||
self:do_attack(hitter)
|
||||
self._aggro= true
|
||||
end
|
||||
end
|
||||
|
||||
-- alert others to the attack
|
||||
local objs = minetest.get_objects_inside_radius(hitter:get_pos(), self.view_range)
|
||||
|
@ -791,7 +792,6 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function mob_class:check_aggro(dtime)
|
||||
|
|
Loading…
Reference in New Issue