summaryrefslogtreecommitdiff
path: root/api.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2016-08-05 12:29:04 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2016-08-05 12:29:04 +0100
commit918abf2cae3fb63477401f6e029b269b58b6147d (patch)
treed06fbe181daa47e20f8173cdca8bde88c1556944 /api.lua
parentd011c538eeffcc3168abaa54750e427cab30951e (diff)
Fix spawning numbers
Diffstat (limited to 'api.lua')
-rw-r--r--api.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/api.lua b/api.lua
index 57a34ee..6b1bcf4 100644
--- a/api.lua
+++ b/api.lua
@@ -1,5 +1,5 @@
--- Mobs Api (3rd August 2016)
+-- Mobs Api (5th August 2016)
mobs = {}
mobs.mod = "redo"
@@ -2374,7 +2374,7 @@ end -- END mobs:register_mob function
-- global functions
function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light,
- interval, chance, active_object_count, min_height, max_height, day_toggle)
+ interval, chance, aoc, min_height, max_height, day_toggle)
-- chance override in minetest.conf for registered mob
local new_chance = tonumber(minetest.setting_get(name .. "_chance"))
@@ -2403,8 +2403,9 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light,
action = function(pos, node, active_object_count, active_object_count_wider)
-- do not spawn if too many active entities in area
- if active_object_count_wider > active_object_count
+ if active_object_count_wider >= aoc
or not mobs.spawning_mobs[name] then
+
return
end