mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-18 16:20:38 +01:00
Reverted commit 8fbd084
This commit is contained in:
parent
8fbd084624
commit
67043e6e50
@ -171,7 +171,7 @@ function mobs:register_mob(name, def)
|
|||||||
end
|
end
|
||||||
|
|
||||||
self.lifetimer = self.lifetimer - dtime
|
self.lifetimer = self.lifetimer - dtime
|
||||||
if self.lifetimer <= 0 and not self.tamed then
|
if self.lifetimer <= 0 and not self.tamed and self.type ~= "npc" then
|
||||||
local player_count = 0
|
local player_count = 0
|
||||||
for _,obj in ipairs(minetest.get_objects_inside_radius(self.object:getpos(), 10)) do
|
for _,obj in ipairs(minetest.get_objects_inside_radius(self.object:getpos(), 10)) do
|
||||||
if obj:is_player() then
|
if obj:is_player() then
|
||||||
@ -798,7 +798,6 @@ function mobs:register_mob(name, def)
|
|||||||
obj:setvelocity(vec)
|
obj:setvelocity(vec)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_activate = function(self, staticdata, dtime_s)
|
on_activate = function(self, staticdata, dtime_s)
|
||||||
@ -812,7 +811,9 @@ function mobs:register_mob(name, def)
|
|||||||
if self.type == "monster" and peaceful_only then
|
if self.type == "monster" and peaceful_only then
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
end
|
end
|
||||||
|
if self.type ~= "npc" then
|
||||||
self.lifetimer = 600 - dtime_s
|
self.lifetimer = 600 - dtime_s
|
||||||
|
end
|
||||||
if staticdata then
|
if staticdata then
|
||||||
local tmp = minetest.deserialize(staticdata)
|
local tmp = minetest.deserialize(staticdata)
|
||||||
if tmp then
|
if tmp then
|
||||||
@ -852,7 +853,7 @@ function mobs:register_mob(name, def)
|
|||||||
if self.type == "monster" and self.tamed == true then
|
if self.type == "monster" and self.tamed == true then
|
||||||
self.type = "npc"
|
self.type = "npc"
|
||||||
end
|
end
|
||||||
if self.lifetimer <= 0 and not self.tamed then
|
if self.lifetimer <= 0 and not self.tamed and self.type ~= "npc" then
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
Loading…
Reference in New Issue
Block a user