diff options
author | h-v-smacker <hans-von-smacker+github@gmail.com> | 2017-12-15 21:07:35 +0300 |
---|---|---|
committer | h-v-smacker <hans-von-smacker+github@gmail.com> | 2017-12-15 21:07:35 +0300 |
commit | 9db2da1e81cbbd7f9d91410396a7c61f909e93e1 (patch) | |
tree | 7ed32efa3b07ffe1a0aaf2d3c36dca40e7045e10 /interest.lua | |
parent | 80c4652c2eb11314d7cd9e1d79673333c808db52 (diff) |
ATM interface overhaul and 2 new ATM types
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) |