diff --git a/modules/game_market/market.lua b/modules/game_market/market.lua index d412ed6d6f..160be5c6eb 100644 --- a/modules/game_market/market.lua +++ b/modules/game_market/market.lua @@ -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 @@ -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 @@ -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 diff --git a/src/client/luafunctions.cpp b/src/client/luafunctions.cpp index ac98380847..c31f56be66 100644 --- a/src/client/luafunctions.cpp +++ b/src/client/luafunctions.cpp @@ -439,6 +439,7 @@ void Client::registerLuaFunctions() g_lua.bindClassMemberFunction("detachEffectById", &Thing::detachEffectById); g_lua.bindClassMemberFunction("getAttachedEffectById", &Thing::getAttachedEffectById); g_lua.bindClassMemberFunction("clearAttachedEffects", &Thing::clearAttachedEffects); + g_lua.bindClassMemberFunction("getClassification", &Thing::getClassification); #ifdef FRAMEWORK_EDITOR g_lua.registerClass(); @@ -605,7 +606,7 @@ void Client::registerLuaFunctions() g_lua.bindClassMemberFunction("isTopEffect", &ThingType::isTopEffect); g_lua.bindClassMemberFunction("getSprites", &ThingType::getSprites); g_lua.bindClassMemberFunction("hasAttribute", &ThingType::hasAttr); - g_lua.bindClassMemberFunction("getUpgradeClassification", &ThingType::getClassification); + g_lua.bindClassMemberFunction("getClassification", &ThingType::getClassification); g_lua.bindClassMemberFunction("hasWearOut", &ThingType::hasWearOut); g_lua.bindClassMemberFunction("hasClockExpire", &ThingType::hasClockExpire); g_lua.bindClassMemberFunction("hasExpire", &ThingType::hasExpire); diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index 817cc0935f..474d386f77 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -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> depotItems; const uint16_t itemsSent = msg->getU16(); for (int_fast32_t i = 0; i < itemsSent; i++) { diff --git a/src/client/thing.h b/src/client/thing.h index f94825232f..e95cfb763b 100644 --- a/src/client/thing.h +++ b/src/client/thing.h @@ -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 {