particle spawners performance adjustments
This commit is contained in:
parent
83838c91bf
commit
7679d1d241
@ -83,9 +83,9 @@ function spawners_mobs.create(mob_name, mod_prefix, size, offset, mesh, texture,
|
|||||||
local id_flame = spawners_mobs.meta_get_int("id_flame", pos)
|
local id_flame = spawners_mobs.meta_get_int("id_flame", pos)
|
||||||
local id_smoke = spawners_mobs.meta_get_int("id_smoke", pos)
|
local id_smoke = spawners_mobs.meta_get_int("id_smoke", pos)
|
||||||
|
|
||||||
if id_flame and id_smoke and id_flame ~= nil and id_smoke ~= nil then
|
if id_flame and id_smoke and id_flame ~= 0 and id_smoke ~= 0 then
|
||||||
-- print("destruct: "..id_flame)
|
print("destruct: "..id_flame)
|
||||||
-- print("destruct: "..id_smoke)
|
print("destruct: "..id_smoke)
|
||||||
minetest.delete_particlespawner(id_flame)
|
minetest.delete_particlespawner(id_flame)
|
||||||
minetest.delete_particlespawner(id_smoke)
|
minetest.delete_particlespawner(id_smoke)
|
||||||
end
|
end
|
||||||
@ -97,14 +97,14 @@ function spawners_mobs.create(mob_name, mod_prefix, size, offset, mesh, texture,
|
|||||||
local player_near = spawners_mobs.check_around_radius(pos)
|
local player_near = spawners_mobs.check_around_radius(pos)
|
||||||
|
|
||||||
-- delete particles
|
-- delete particles
|
||||||
if id_flame and id_smoke and id_flame ~= nil and id_smoke ~= nil and player_near == false then
|
if id_flame and id_smoke and id_flame ~= nil and id_smoke ~= nil and id_flame ~= 0 and id_smoke ~= 0 and player_near == false then
|
||||||
print("player_near: false")
|
print("player_near: false")
|
||||||
print("destruct: "..id_flame)
|
print("destruct: "..id_flame)
|
||||||
print("destruct: "..id_smoke)
|
print("destruct: "..id_smoke)
|
||||||
minetest.delete_particlespawner(id_flame)
|
minetest.delete_particlespawner(id_flame)
|
||||||
minetest.delete_particlespawner(id_smoke)
|
minetest.delete_particlespawner(id_smoke)
|
||||||
spawners_mobs.meta_set_int("id_flame", nil, pos)
|
spawners_mobs.meta_set_int("id_flame", 0, pos)
|
||||||
spawners_mobs.meta_set_int("id_smoke", nil, pos)
|
spawners_mobs.meta_set_int("id_smoke", 0, pos)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- add particles
|
-- add particles
|
||||||
@ -144,7 +144,7 @@ function spawners_mobs.create(mob_name, mod_prefix, size, offset, mesh, texture,
|
|||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
tiles = {
|
tiles = {
|
||||||
{
|
{
|
||||||
name = "spawners_mobs_spawner_waiting_animated.png",
|
name = "spawners_mobs_spawner_waiting_animated_16.png",
|
||||||
animation = {
|
animation = {
|
||||||
type = "vertical_frames",
|
type = "vertical_frames",
|
||||||
aspect_w = 32,
|
aspect_w = 32,
|
||||||
|
Loading…
Reference in New Issue
Block a user