fix: show buy/sell vendor failures in UIError overlay

SMSG_BUY_FAILED ("Not enough money", "Sold out", etc.) and
SMSG_SELL_ITEM non-zero results now call addUIError() so the error
appears on screen alongside the chat message.
This commit is contained in:
Kelsi 2026-03-17 17:25:27 -07:00
parent fba6aba80d
commit 495dfb7aae

View file

@ -4582,6 +4582,7 @@ void GameHandler::handlePacket(network::Packet& packet) {
"Unknown error", "Only empty bag"
};
const char* msg = (result < 7) ? sellErrors[result] : "Unknown sell error";
addUIError(std::string("Sell failed: ") + msg);
addSystemChatMessage(std::string("Sell failed: ") + msg);
if (auto* renderer = core::Application::getInstance().getRenderer()) {
if (auto* sfx = renderer->getUiSoundManager())
@ -4744,6 +4745,7 @@ void GameHandler::handlePacket(network::Packet& packet) {
case 6: msg = "You can't carry any more items."; break;
default: break;
}
addUIError(msg);
addSystemChatMessage(msg);
if (auto* renderer = core::Application::getInstance().getRenderer()) {
if (auto* sfx = renderer->getUiSoundManager())