• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved TFS 1.2 - Client version 10.00 Bug Trade window from npc

Tampek

ECHO 'Zarkonia.online';
Joined
Dec 29, 2015
Messages
480
Solutions
5
Reaction score
33
Location
Spain
TFS 1.3 - Client version 10.00 Bug Trade window from npc!

- Recent changes on my source i can login, and play perfect, use spells and do missions but i have other issue:

- Npc works fine but time to sell or buy items by "trade" client crash

Only crash it -><parameter key="shop_sellable" value="

b5db16ea96dd94ed765b30fff794078f.png


https://github.com/otland/forgottenserver/issues/2045
 
Last edited:
How i can add byte to source on part tradewindow from npcs?

I know what happens -> if Trade window have + 3 slots and you need move down with mouse crash client.

Code:
void ProtocolGame::sendMarketBrowseOwnHistory(const HistoryMarketOfferList& buyOffers, const HistoryMarketOfferList& sellOffers)
{
    uint32_t i = 0;
    std::map<uint32_t, uint16_t> counterMap;
    uint32_t buyOffersToSend = std::min<uint32_t>(buyOffers.size(), 810 + std::max<int32_t>(0, 810 - sellOffers.size()));
    uint32_t sellOffersToSend = std::min<uint32_t>(sellOffers.size(), 810 + std::max<int32_t>(0, 810 - buyOffers.size()));

    NetworkMessage msg;
    msg.addByte(0xF9);
    msg.add<uint16_t>(MARKETREQUEST_OWN_HISTORY);

    msg.add<uint32_t>(buyOffersToSend);
    for (auto it = buyOffers.begin(); i < buyOffersToSend; ++it, ++i) {
        msg.add<uint32_t>(it->timestamp);
        msg.add<uint16_t>(counterMap[it->timestamp]++);
        msg.addItemId(it->itemId);
        msg.add<uint16_t>(it->amount);
        msg.add<uint32_t>(it->price);
        msg.addByte(it->state);
    }

    counterMap.clear();
    i = 0;

    msg.add<uint32_t>(sellOffersToSend);
    for (auto it = sellOffers.begin(); i < sellOffersToSend; ++it, ++i) {
        msg.add<uint32_t>(it->timestamp);
        msg.add<uint16_t>(counterMap[it->timestamp]++);
        msg.addItemId(it->itemId);
        msg.add<uint16_t>(it->amount);
        msg.add<uint32_t>(it->price);
        msg.addByte(it->state);
    }

    writeToOutputBuffer(msg);
}
 
Last edited:
Back
Top