mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2024-12-24 01:30:22 +01:00
fix replace function running too often when mob attacks
This commit is contained in:
parent
00f46f66d5
commit
22cf9b880a
9
api.lua
9
api.lua
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
mobs = {}
|
mobs = {}
|
||||||
mobs.mod = "redo"
|
mobs.mod = "redo"
|
||||||
mobs.version = "20180414"
|
mobs.version = "20180419"
|
||||||
|
|
||||||
|
|
||||||
-- Intllib
|
-- Intllib
|
||||||
@ -2822,9 +2822,6 @@ local mob_step = function(self, dtime)
|
|||||||
self.timer = 1
|
self.timer = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
-- node replace check (cow eats grass etc.)
|
|
||||||
replace(self, pos)
|
|
||||||
|
|
||||||
-- mob plays random sound at times
|
-- mob plays random sound at times
|
||||||
if random(1, 100) == 1 then
|
if random(1, 100) == 1 then
|
||||||
mob_sound(self, self.sounds.random)
|
mob_sound(self, self.sounds.random)
|
||||||
@ -2838,7 +2835,11 @@ local mob_step = function(self, dtime)
|
|||||||
|
|
||||||
self.env_damage_timer = 0
|
self.env_damage_timer = 0
|
||||||
|
|
||||||
|
-- check for environmental damage (water, fire, lava etc.)
|
||||||
do_env_damage(self)
|
do_env_damage(self)
|
||||||
|
|
||||||
|
-- node replace check (cow eats grass etc.)
|
||||||
|
replace(self, pos)
|
||||||
end
|
end
|
||||||
|
|
||||||
monster_attack(self)
|
monster_attack(self)
|
||||||
|
Loading…
Reference in New Issue
Block a user