Skip to content

Commit

Permalink
use player:get_meta
Browse files Browse the repository at this point in the history
fixes #51
  • Loading branch information
BuckarooBanzay committed May 23, 2021
1 parent 081a016 commit 9da14a2
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions globalstep.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@ minetest.register_globalstep(function(dtime)
if timer >= 3 then
local players = minetest.get_connected_players()
for _,player in pairs(players) do
local xp = player:get_attribute("xp")

if xp == nil then
xp = 0
player:set_attribute("xp", xp)
else
xp = tonumber(xp)
end
local meta = player:get_meta()
local xp = meta:get_int("xp")

local rank = xp_redo.get_rank(xp)
local next_rank = xp_redo.get_next_rank(xp, rank)
Expand Down

0 comments on commit 9da14a2

Please sign in to comment.