mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
[Bug Fix] Fix for players having empty bazaar window dropdown list, even though trader is tagged as a trader. (#4391)
* Potential fix for players having empty bazaar window dropdown list, even though trader is tagged as a trader. * Update the truncate of the trader table to avoid inappropriate deletions if an instance of bazaar was started.
This commit is contained in:
parent
850053a136
commit
b6b8491060
@ -542,8 +542,8 @@ namespace RoF2
|
||||
LogTrading(
|
||||
"(RoF2) AddTraderToBazaarWindow action <green>[{}] trader_id <green>[{}] entity_id <green>[{}] zone_id <green>[{}]",
|
||||
eq->action,
|
||||
eq->entity_id,
|
||||
eq->trader_id,
|
||||
eq->entity_id,
|
||||
eq->zone_id
|
||||
);
|
||||
dest->FastQueuePacket(&outapp);
|
||||
|
||||
@ -1049,6 +1049,10 @@ void Client::TraderStartTrader(const EQApplicationPacket *app)
|
||||
|
||||
//Check inventory for no-trade items
|
||||
for (auto const &i: inv->serial_number) {
|
||||
if (i <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
auto inst = FindTraderItemBySerialNumber(i);
|
||||
if (inst) {
|
||||
if (inst->GetItem() && inst->GetItem()->NoDrop == 0) {
|
||||
@ -1067,7 +1071,16 @@ void Client::TraderStartTrader(const EQApplicationPacket *app)
|
||||
}
|
||||
|
||||
for (uint32 i = 0; i < max_items; i++) {
|
||||
if (inv->serial_number[i] <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
auto inst = FindTraderItemBySerialNumber(inv->serial_number[i]);
|
||||
if (!inst) {
|
||||
trade_items_valid = false;
|
||||
break;
|
||||
}
|
||||
|
||||
auto it = std::find(std::begin(in->serial_number), std::end(in->serial_number), inv->serial_number[i]);
|
||||
if (inst && it != std::end(in->serial_number)) {
|
||||
inst->SetPrice(in->item_cost[i]);
|
||||
@ -1106,18 +1119,16 @@ void Client::TraderStartTrader(const EQApplicationPacket *app)
|
||||
trade_items_valid = false;
|
||||
continue;
|
||||
}
|
||||
else if (!in->serial_number[i]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!trade_items_valid) {
|
||||
Message(Chat::Red, "You are not able to become a trader at this time.");
|
||||
Message(Chat::Red, "You are not able to become a trader at this time. Invalid item found.");
|
||||
TraderEndTrader();
|
||||
safe_delete(inv);
|
||||
return;
|
||||
}
|
||||
|
||||
TraderRepository::DeleteWhere(database, fmt::format("`char_id` = '{}';", CharacterID()));
|
||||
TraderRepository::ReplaceMany(database, trader_items);
|
||||
safe_delete(inv);
|
||||
|
||||
|
||||
@ -1194,13 +1194,6 @@ bool Zone::Init(bool is_static) {
|
||||
LoadZoneObjects();
|
||||
LoadZoneDoors();
|
||||
LoadZoneBlockedSpells();
|
||||
|
||||
//clear trader items if we are loading the bazaar
|
||||
if (strncasecmp(short_name, "bazaar", 6) == 0) {
|
||||
TraderRepository::Truncate(database);
|
||||
database.DeleteBuyLines(0);
|
||||
}
|
||||
|
||||
LoadVeteranRewards();
|
||||
LoadAlternateCurrencies();
|
||||
LoadNPCEmotes(&npc_emote_list);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user