summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2018-04-19 15:45:03 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2018-04-19 15:45:03 +0100
commit22cf9b880a56710403beb3e66e465989c3a8e11e (patch)
treede88ca2cb62c0611708a5afd6b07ba1e63489474
parent00f46f66d5fb99cba0dae2aea5fdbced4d722d2c (diff)
fix replace function running too often when mob attacks
-rw-r--r--api.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/api.lua b/api.lua
index d61aa89..3c23316 100644
--- a/api.lua
+++ b/api.lua
@@ -3,7 +3,7 @@
mobs = {}
mobs.mod = "redo"
-mobs.version = "20180414"
+mobs.version = "20180419"
-- Intllib
@@ -2822,9 +2822,6 @@ local mob_step = function(self, dtime)
self.timer = 1
end
- -- node replace check (cow eats grass etc.)
- replace(self, pos)
-
-- mob plays random sound at times
if random(1, 100) == 1 then
mob_sound(self, self.sounds.random)
@@ -2838,7 +2835,11 @@ local mob_step = function(self, dtime)
self.env_damage_timer = 0
+ -- check for environmental damage (water, fire, lava etc.)
do_env_damage(self)
+
+ -- node replace check (cow eats grass etc.)
+ replace(self, pos)
end
monster_attack(self)