• 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!

Solved convert code from tfs 1.2 to 1.4/1.5

johnsamir

Advanced OT User
Joined
Oct 13, 2009
Messages
965
Solutions
6
Reaction score
165
Location
Nowhere
help convert code i took this from tfs 1.2 and my server is 1.4/1.5 have tried several ways with no luck


Lua:
MarketStatistics* statistics = IOMarket::getInstance()->getPurchaseStatistics(itemId);
if (statistics) {
    msg.addByte(0x01);
    msg.add<uint32_t>(statistics->numTransactions);
    msg.add<uint32_t>(std::min<uint64_t>(std::numeric_limits<uint32_t>::max(), statistics->totalPrice));
    msg.add<uint32_t>(statistics->highestPrice);
    msg.add<uint32_t>(statistics->lowestPrice);
}
else {
    msg.addByte(0x00);
}

//statistics = IOMarket::getInstance()->getSaleStatistics(itemId); //original
 //statistics = marketInstance->getSaleStatistics(itemId);
//MarketStatistics* statistics = marketInstance->getSaleStatistics(itemId);
statistics = IOMarket::getInstance()->getSaleStatistics(itemId);

Lua:
MarketStatistics* statistics = IOMarket::getInstance()->getPurchaseStatistics(itemId);
and this code
Code:
statistics = IOMarket::getInstance()->getSaleStatistics(itemId)
is giving me errors
the error says -> or ->* applied to "IOMarket" instead of to a pointer type
Post automatically merged:

nvm: solved changed -> to . it compiles
 
Back
Top