Skip to content

Commit

Permalink
Don't save player ref after callback
Browse files Browse the repository at this point in the history
  • Loading branch information
raymoo committed Mar 6, 2022
1 parent ed11a73 commit 08bc018
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ local function test(player)
minetest.chat_send_player(p_name, "Your speed is: " .. speed:value(player))

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)
minetest.chat_send_player(p_name, "Your speed is: " .. speed:value(player))
end)
Expand Down

0 comments on commit 08bc018

Please sign in to comment.