diff options
author | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2016-06-25 15:09:48 +0200 |
---|---|---|
committer | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2016-06-25 15:09:48 +0200 |
commit | 6f6a6de54bf7a7562ca374a0f30ac854877dbea2 (patch) | |
tree | ce93238e9395e0ecfe4c43bc04bac2da8b6f39ec | |
parent | b9fb56cc691b8dadb161dbe1cf42d402f80eb3fc (diff) |
Now reads accounts before showing formspec
-rw-r--r-- | init.lua | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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) |