diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2016-04-25 20:23:38 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2016-04-25 20:23:38 +0100 |
commit | b512f882e9ba3d255117aa3f4c00c5fb5e6a426f (patch) | |
tree | e641f679738b1c20a04d32f51f0c3ead8b5e2a12 | |
parent | 4d3438aeed1bac581fefd720355633139e297b73 (diff) |
Disable lifetimer if remove_far_mobs is true, despawn distance set to 15
-rw-r--r-- | api.lua | 7 | ||||
-rw-r--r-- | spawner.lua | 2 |
2 files changed, 5 insertions, 4 deletions
@@ -1,5 +1,5 @@ --- Mobs Api (16th April 2016) +-- Mobs Api (25th April 2016) mobs = {} mobs.mod = "redo" @@ -1977,14 +1977,15 @@ local mob_step = function(self, dtime) -- when lifetimer expires remove mob (except npc and tamed) if self.type ~= "npc" and not self.tamed - and self.state ~= "attack" then + and self.state ~= "attack" + and remove_far ~= true then self.lifetimer = self.lifetimer - dtime if self.lifetimer <= 0 then -- only despawn away from player - local objs = minetest.get_objects_inside_radius(pos, 10) + local objs = minetest.get_objects_inside_radius(pos, 15) for _,oir in pairs(objs) do diff --git a/spawner.lua b/spawner.lua index 4355770..d797184 100644 --- a/spawner.lua +++ b/spawner.lua @@ -1,7 +1,7 @@ -- mob spawner -local spawner_default = "mobs:pumba 10 15 0 0" +local spawner_default = "mobs_animal:pumba 10 15 0 0" minetest.register_node("mobs:spawner", { tiles = {"mob_spawner.png"}, |