Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions modules/game_market/market.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ function init()
onMarketDetail = Market.onMarketDetail,
onMarketReadOffer = Market.onMarketReadOffer,
onMarketLeave = Market.onMarketLeave,
onResourcesBalanceChange = Market.onResourceBalanceChange
onResourcesBalanceChange = Market.onResourcesBalanceChange
})
connect(g_game, {
onGameEnd = Market.close
Expand All @@ -1114,7 +1114,7 @@ function terminate()
onMarketDetail = Market.onMarketDetail,
onMarketReadOffer = Market.onMarketReadOffer,
onMarketLeave = Market.onMarketLeave,
onResourceBalancesChange = Market.onResourceBalanceChange
onResourcesBalanceChange = Market.onResourcesBalanceChange
})
disconnect(g_game, {
onGameEnd = Market.close
Expand Down Expand Up @@ -1406,7 +1406,8 @@ function Market.createNewOffer()
return
end

g_game.createMarketOffer(type, spriteId, amount, piecePrice, anonymous)
local itemTier = Item.create(spriteId):getClassification()
g_game.createMarketOffer(type, spriteId, itemTier, amount, piecePrice, anonymous)
lastCreatedOffer = os.time()
Market.resetCreateOffer()
end
Expand Down
3 changes: 2 additions & 1 deletion src/client/luafunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ void Client::registerLuaFunctions()
g_lua.bindClassMemberFunction<Thing>("detachEffectById", &Thing::detachEffectById);
g_lua.bindClassMemberFunction<Thing>("getAttachedEffectById", &Thing::getAttachedEffectById);
g_lua.bindClassMemberFunction<Thing>("clearAttachedEffects", &Thing::clearAttachedEffects);
g_lua.bindClassMemberFunction<Thing>("getClassification", &Thing::getClassification);

#ifdef FRAMEWORK_EDITOR
g_lua.registerClass<House>();
Expand Down Expand Up @@ -605,7 +606,7 @@ void Client::registerLuaFunctions()
g_lua.bindClassMemberFunction<ThingType>("isTopEffect", &ThingType::isTopEffect);
g_lua.bindClassMemberFunction<ThingType>("getSprites", &ThingType::getSprites);
g_lua.bindClassMemberFunction<ThingType>("hasAttribute", &ThingType::hasAttr);
g_lua.bindClassMemberFunction<ThingType>("getUpgradeClassification", &ThingType::getClassification);
g_lua.bindClassMemberFunction<ThingType>("getClassification", &ThingType::getClassification);
g_lua.bindClassMemberFunction<ThingType>("hasWearOut", &ThingType::hasWearOut);
g_lua.bindClassMemberFunction<ThingType>("hasClockExpire", &ThingType::hasClockExpire);
g_lua.bindClassMemberFunction<ThingType>("hasExpire", &ThingType::hasExpire);
Expand Down
4 changes: 0 additions & 4 deletions src/client/protocolgameparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3556,10 +3556,6 @@ void ProtocolGame::parseError(const InputMessagePtr& msg)
void ProtocolGame::parseMarketEnter(const InputMessagePtr& msg)
{
const uint8_t offers = msg->getU8();
if (const uint16_t depotLocker = msg->peekU16(); depotLocker == 0x00) {
return;
}

std::vector<std::vector<uint16_t>> depotItems;
const uint16_t itemsSent = msg->getU16();
for (int_fast32_t i = 0; i < itemsSent; i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/client/thing.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class Thing : public LuaObject

PLAYER_ACTION getDefaultAction() { return m_thingType->getDefaultAction(); }

uint16_t getClassification() const { return m_thingType->getClassification(); }
uint16_t getClassification() { return m_thingType->getClassification(); }

void canDraw(bool canDraw) { m_canDraw = canDraw; }
inline bool canDraw(const Color& color = Color::white) const {
Expand Down