Use more locals

master
Wuzzy 2016-09-02 07:40:18 +02:00
parent be643ea1a9
commit 380b7af63d
1 changed files with 2 additions and 0 deletions

View File

@ -371,6 +371,7 @@ easyvend.on_receive_fields_customer = function(pos, formname, fields, sender)
end
minetest.chat_send_player(sendername, msg)
else
local msg
if not chest_has and not player_has then
msg = "You can't afford this item, and the vending machine has insufficient materials!"
easyvend.machine_disable(pos, node, sendername)
@ -470,6 +471,7 @@ easyvend.on_receive_fields_customer = function(pos, formname, fields, sender)
end
minetest.chat_send_player(sendername, msg)
else
local msg
if not chest_has and not player_has then
msg = "You have insufficient materials, and the depositing machine can't afford to pay you!"
easyvend.machine_disable(pos, node, sendername)