forked from minetest-mods/global_exchange
Fix crash if buyer out of funds
This commit is contained in:
parent
15bba05412
commit
969571f559
14
exchange.lua
14
exchange.lua
@ -1088,12 +1088,14 @@ function ex_methods.sell(self, p_name, ex_name, item_name, wear, amount, rate)
|
|||||||
sql_error(db:errmsg())
|
sql_error(db:errmsg())
|
||||||
end
|
end
|
||||||
|
|
||||||
local in_succ, in_err =
|
if not out_of_funds then
|
||||||
self:put_in_inbox(poster, item_name, wear, row_sold)
|
local in_succ, in_err =
|
||||||
if not in_succ then
|
self:put_in_inbox(poster, item_name, wear, row_sold)
|
||||||
search_stmt:reset()
|
if not in_succ then
|
||||||
db:exec("ROLLBACK;")
|
search_stmt:reset()
|
||||||
return false, in_err
|
db:exec("ROLLBACK;")
|
||||||
|
return false, in_err
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if poster ~= p_name then
|
if poster ~= p_name then
|
||||||
|
Loading…
Reference in New Issue
Block a user