diff options
Diffstat (limited to 'interest.lua')
-rw-r--r-- | interest.lua | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/interest.lua b/interest.lua index d1d7980..e492566 100644 --- a/interest.lua +++ b/interest.lua @@ -1,16 +1,16 @@ -- adapted from the income.lua file from the currency mod. local timer = 0 minetest.register_globalstep(function(dtime) - timer = timer + dtime; - if timer >= 1000 then - timer = 0 - atm.readaccounts() - for _,player in ipairs(minetest.get_connected_players()) do - local name = player:get_player_name() - if not (atm.balance[name] == nil) then - atm.balance[name] = math.floor(atm.balance[name] + 5) - end - end - atm.saveaccounts() - end + timer = timer + dtime; + if timer >= 1000 then + timer = 0 + atm.readaccounts() + for _,player in ipairs(minetest.get_connected_players()) do + local name = player:get_player_name() + if not (atm.balance[name] == nil) then + atm.balance[name] = math.floor(atm.balance[name] + 5) + end + end + atm.saveaccounts() + end end) |