mirror of
https://repo.or.cz/minetest_playereffects.git
synced 2025-01-09 18:40:18 +01:00
on_joinplayer workaround
This commit is contained in:
parent
4c1d480f82
commit
b6b3ac82ce
9
init.lua
9
init.lua
@ -147,21 +147,22 @@ end)
|
|||||||
|
|
||||||
|
|
||||||
minetest.register_on_joinplayer(function(player)
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
minetest.after(0, playereffects.join0, player)
|
||||||
|
end)
|
||||||
|
|
||||||
|
function playereffects.join0(player)
|
||||||
local playername = player:get_player_name()
|
local playername = player:get_player_name()
|
||||||
|
|
||||||
-- load all the effects again (if any)
|
-- load all the effects again (if any)
|
||||||
if(playereffects.inactive_effects[playername] ~= nil) then
|
if(playereffects.inactive_effects[playername] ~= nil) then
|
||||||
for i=1,#playereffects.inactive_effects[playername] do
|
for i=1,#playereffects.inactive_effects[playername] do
|
||||||
local effect = playereffects.inactive_effects[playername][i]
|
local effect = playereffects.inactive_effects[playername][i]
|
||||||
-- minetest.after(0, function(effect, player)
|
|
||||||
-- playereffects.apply_effect_type(effect.effect_type_id, effect.time_left, player) end,
|
|
||||||
-- effect, player)
|
|
||||||
playereffects.apply_effect_type(effect.effect_type_id, effect.time_left, player)
|
playereffects.apply_effect_type(effect.effect_type_id, effect.time_left, player)
|
||||||
end
|
end
|
||||||
playereffects.inactive_effects[playername] = nil
|
playereffects.inactive_effects[playername] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
end)
|
end
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
minetest.register_on_shutdown(function()
|
minetest.register_on_shutdown(function()
|
||||||
|
Loading…
Reference in New Issue
Block a user