forked from minetest-mods/player_monoids
Don't save player ref after callback
This commit is contained in:
parent
ed11a7395b
commit
08bc018f92
2
test.lua
2
test.lua
@ -14,6 +14,8 @@ local function test(player)
|
|||||||
minetest.chat_send_player(p_name, "Your speed is: " .. speed:value(player))
|
minetest.chat_send_player(p_name, "Your speed is: " .. speed:value(player))
|
||||||
|
|
||||||
minetest.after(3, function()
|
minetest.after(3, function()
|
||||||
|
local player = minetest.get_player_by_name(p_name)
|
||||||
|
if not player then return end
|
||||||
speed:del_change(player, ch_id)
|
speed:del_change(player, ch_id)
|
||||||
minetest.chat_send_player(p_name, "Your speed is: " .. speed:value(player))
|
minetest.chat_send_player(p_name, "Your speed is: " .. speed:value(player))
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user