|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Copyright (C) 2021, 2022 Ale
|
|
|
|
|
-- Copyright (C) 2021, 2023 Ale
|
|
|
|
|
|
|
|
|
|
-- This file is part of Emeraldbank Minetest Mod.
|
|
|
|
|
|
|
|
|
@ -298,7 +298,7 @@ core.register_on_player_receive_fields(function(sender, formname, fields)
|
|
|
|
|
|
|
|
|
|
-- owner try exchanges
|
|
|
|
|
if meta:get_string("owner") == name then
|
|
|
|
|
mcl_title.set(sender, "subtitle", {text=S("This is your own shop, you can't exchange to yourself!"), color="dark_red"})
|
|
|
|
|
core.chat_send_player(name, S("This is your own shop, you can't exchange to yourself!"))
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
|
@ -307,13 +307,13 @@ core.register_on_player_receive_fields(function(sender, formname, fields)
|
|
|
|
|
-- have u money?
|
|
|
|
|
if bankemeralds < old_price then
|
|
|
|
|
can_exchange = false
|
|
|
|
|
mcl_title.set(sender, "subtitle", {text=S("Not enough Emeralds in your account"), color="dark_red"})
|
|
|
|
|
core.chat_send_player(name, S("Not enough Emeralds in your account"))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--there are enough items?
|
|
|
|
|
if not minv:contains_item("stock", shop_item.." "..old_count, true) then
|
|
|
|
|
can_exchange = false
|
|
|
|
|
mcl_title.set(sender, "subtitle", {text=S("Out of Stock!"), color="dark_red"})
|
|
|
|
|
core.chat_send_player(name, S("Out of Stock!"))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- do not trade air
|
|
|
|
|