forked from VoxeLibre/VoxeLibre
Mobs should not anger towards the player if damage is disabled.
MineClone2/MineClone2#3458
This commit is contained in:
parent
d3c591915f
commit
fa1be6df89
|
@ -35,14 +35,19 @@ function mob_class:day_docile()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- attack player/mob
|
-- get this mob to attack the object
|
||||||
function mob_class:do_attack(player)
|
function mob_class:do_attack(object)
|
||||||
|
|
||||||
if self.state == "attack" or self.state == "die" then
|
if self.state == "attack" or self.state == "die" then
|
||||||
return
|
return
|
||||||
end
|
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"
|
self.state = "attack"
|
||||||
|
|
||||||
-- TODO: Implement war_cry sound without being annoying
|
-- TODO: Implement war_cry sound without being annoying
|
||||||
|
|
Loading…
Reference in New Issue