From 8fbd0846246d36dfbcd0bee1e650604bc4d85317 Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Sat, 11 Apr 2015 15:41:57 +0200 Subject: [PATCH] Removed inhibition of lifetimer system about npcs - NPCs have now a 600sec (10min) lifetime --- mods/mobs/api.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mods/mobs/api.lua b/mods/mobs/api.lua index 61804991..53713f6a 100755 --- a/mods/mobs/api.lua +++ b/mods/mobs/api.lua @@ -171,7 +171,7 @@ function mobs:register_mob(name, def) end self.lifetimer = self.lifetimer - dtime - if self.lifetimer <= 0 and not self.tamed and self.type ~= "npc" then + if self.lifetimer <= 0 and not self.tamed then local player_count = 0 for _,obj in ipairs(minetest.get_objects_inside_radius(self.object:getpos(), 10)) do if obj:is_player() then @@ -798,6 +798,7 @@ function mobs:register_mob(name, def) obj:setvelocity(vec) end end + end, on_activate = function(self, staticdata, dtime_s) @@ -811,9 +812,7 @@ function mobs:register_mob(name, def) if self.type == "monster" and peaceful_only then self.object:remove() end - if self.type ~= "npc" then - self.lifetimer = 600 - dtime_s - end + self.lifetimer = 600 - dtime_s if staticdata then local tmp = minetest.deserialize(staticdata) if tmp then @@ -853,7 +852,7 @@ function mobs:register_mob(name, def) if self.type == "monster" and self.tamed == true then self.type = "npc" end - if self.lifetimer <= 0 and not self.tamed and self.type ~= "npc" then + if self.lifetimer <= 0 and not self.tamed then self.object:remove() end end,