mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2024-12-25 02:00:21 +01:00
Disable lifetimer if remove_far_mobs is true, despawn distance set to 15
This commit is contained in:
parent
4d3438aeed
commit
b512f882e9
7
api.lua
7
api.lua
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
-- Mobs Api (16th April 2016)
|
-- Mobs Api (25th April 2016)
|
||||||
|
|
||||||
mobs = {}
|
mobs = {}
|
||||||
mobs.mod = "redo"
|
mobs.mod = "redo"
|
||||||
@ -1977,14 +1977,15 @@ local mob_step = function(self, dtime)
|
|||||||
-- when lifetimer expires remove mob (except npc and tamed)
|
-- when lifetimer expires remove mob (except npc and tamed)
|
||||||
if self.type ~= "npc"
|
if self.type ~= "npc"
|
||||||
and not self.tamed
|
and not self.tamed
|
||||||
and self.state ~= "attack" then
|
and self.state ~= "attack"
|
||||||
|
and remove_far ~= true then
|
||||||
|
|
||||||
self.lifetimer = self.lifetimer - dtime
|
self.lifetimer = self.lifetimer - dtime
|
||||||
|
|
||||||
if self.lifetimer <= 0 then
|
if self.lifetimer <= 0 then
|
||||||
|
|
||||||
-- only despawn away from player
|
-- 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
|
for _,oir in pairs(objs) do
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
-- mob spawner
|
-- 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", {
|
minetest.register_node("mobs:spawner", {
|
||||||
tiles = {"mob_spawner.png"},
|
tiles = {"mob_spawner.png"},
|
||||||
|
Loading…
Reference in New Issue
Block a user