mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-25 12:01:06 +01:00
Mobs should not anger towards the player if damage is disabled. (#4114)
Co-authored-by: Mateusz Uzdowski <mateusz@silverstripe.com> Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/4114 Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land> Co-authored-by: emptyshore <emptyshore@noreply.git.minetest.land> Co-committed-by: emptyshore <emptyshore@noreply.git.minetest.land>
This commit is contained in:
parent
d3c591915f
commit
8e103cf615
1 changed files with 8 additions and 3 deletions
|
@ -35,14 +35,19 @@ function mob_class:day_docile()
|
|||
end
|
||||
end
|
||||
|
||||
-- attack player/mob
|
||||
function mob_class:do_attack(player)
|
||||
-- get this mob to attack the object
|
||||
function mob_class:do_attack(object)
|
||||
|
||||
if self.state == "attack" or self.state == "die" then
|
||||
return
|
||||
end
|
||||
|
||||
self.attack = player
|
||||
|
||||
if object:is_player() and not minetest.settings:get_bool("enable_damage") then
|
||||
return
|
||||
end
|
||||
|
||||
self.attack = object
|
||||
self.state = "attack"
|
||||
|
||||
-- TODO: Implement war_cry sound without being annoying
|
||||
|
|
Loading…
Reference in a new issue