From 440bf560607d4f5fc2bd03c84b750bcb5f86d650 Mon Sep 17 00:00:00 2001 From: OTCv8 Date: Thu, 23 Jan 2020 08:00:37 +0100 Subject: [PATCH] Updated market to work on >10.90 --- modules/game_market/market.lua | 6 ++++-- modules/game_market/marketprotocol.lua | 9 +++++++++ modules/game_market/ui/marketoffers/itemdetails.otui | 2 +- modules/game_walking/walking.lua | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/modules/game_market/market.lua b/modules/game_market/market.lua index b6e3936..ebe5645 100644 --- a/modules/game_market/market.lua +++ b/modules/game_market/market.lua @@ -726,8 +726,10 @@ local function initMarketItems() } -- add new market item - table.insert(marketItems[marketData.category], marketItem) - itemSet[marketData.tradeAs] = true + if marketItems[marketData.category] ~= nil then + table.insert(marketItems[marketData.category], marketItem) + itemSet[marketData.tradeAs] = true + end end end end diff --git a/modules/game_market/marketprotocol.lua b/modules/game_market/marketprotocol.lua index d9ca252..0df40e9 100644 --- a/modules/game_market/marketprotocol.lua +++ b/modules/game_market/marketprotocol.lua @@ -81,6 +81,15 @@ local function parseMarketDetail(protocol, msg) msg:getU16() end end + + if g_game.getClientVersion() >= 1100 then -- imbuements + if msg:peekU16() ~= 0x00 then + table.insert(descriptions, {MarketItemDescription.Last + 1, msg:getString()}) + else + msg:getU16() + end + end + local time = (os.time() / 1000) * statistics.SECONDS_PER_DAY; local purchaseStats = {} diff --git a/modules/game_market/ui/marketoffers/itemdetails.otui b/modules/game_market/ui/marketoffers/itemdetails.otui index 310f858..d90dbee 100644 --- a/modules/game_market/ui/marketoffers/itemdetails.otui +++ b/modules/game_market/ui/marketoffers/itemdetails.otui @@ -11,7 +11,7 @@ DetailsTableRow < TableRow DetailsTableColumn < TableColumn font: verdana-11px-monochrome background-color: alpha - text-offset: 5 2 + text-offset: 2 2 color: #cccccc width: 100 focusable: false diff --git a/modules/game_walking/walking.lua b/modules/game_walking/walking.lua index 2c3f8cd..b6474e2 100644 --- a/modules/game_walking/walking.lua +++ b/modules/game_walking/walking.lua @@ -289,7 +289,7 @@ function walk(dir, ticks) local dash = false local ignoredCanWalk = false if not g_game.getFeature(GameNewWalking) then - dash = g_settings.getBoolean("dash", true) + dash = g_settings.getBoolean("dash", false) end local ticksToNextWalk = player:getStepTicksLeft()