fix spawners mobs registration

This commit is contained in:
Juraj Vajda 2023-04-24 11:55:32 -04:00
parent c8f25738ac
commit 9317290a50
4 changed files with 46 additions and 42 deletions

2
.gitattributes vendored
View File

@ -2,7 +2,7 @@
.* export-ignore .* export-ignore
assets export-ignore assets export-ignore
scripts export-ignore *.js export-ignore
bin export-ignore bin export-ignore
docs export-ignore docs export-ignore
types export-ignore types export-ignore

View File

@ -27,8 +27,9 @@ local enable_particles = minetest.settings:get_bool('enable_particles')
local tick_max = 30 local tick_max = 30
local tick_short_max = 20 local tick_short_max = 20
-- check if mods exists and build tables function spawners_mobs.register_spawners()
for k, mob_mod in ipairs(spawners_mobs.ENABLED_MODS) do -- check if mods exists and build tables
for k, mob_mod in ipairs(spawners_mobs.ENABLED_MODS) do
local modpath = minetest.get_modpath(mob_mod) local modpath = minetest.get_modpath(mob_mod)
-- list of mobs and their info -- list of mobs and their info
if (modpath) then if (modpath) then
@ -72,6 +73,7 @@ for k, mob_mod in ipairs(spawners_mobs.ENABLED_MODS) do
-- ::continue:: -- ::continue::
end end
end end
end
end end
-- --

View File

@ -254,3 +254,5 @@ if minetest.get_modpath('mobs') ~= nil then
} }
} }
end end
spawners_mobs.register_spawners()

View File

@ -39,4 +39,4 @@ end
local mod_end_time = (minetest.get_us_time() - mod_start_time) / 1000000 local mod_end_time = (minetest.get_us_time() - mod_start_time) / 1000000
print ('[Mod] Spawners Mobs Loaded. [' .. mod_end_time .. 's]') print('[Mod] Spawners Mobs Loaded. [' .. mod_end_time .. 's]')