aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index 5839ce9..ef2e776 100644
--- a/init.lua
+++ b/init.lua
@@ -2,6 +2,7 @@ atm = {}
atm.balance = {}
function atm.showform (player)
+ atm.readaccounts()
if not atm.balance[player:get_player_name()] then
atm.balance[player:get_player_name()] = 0
end
@@ -167,10 +168,10 @@ minetest.register_on_player_receive_fields(function(player, form, pressed)
else
atm.balance[n] = atm.balance[n] + amount
end
+ atm.saveaccounts()
if not pressed.Quit then
atm.showform(player)
end
- atm.saveaccounts()
end
end)