Market updates, now using showAs / tradeAs so every items works properly, some cleanup / bug fixing

This commit is contained in:
TheSumm
2015-01-23 02:52:05 +01:00
parent 92e2e8224f
commit 3157e7924f
2 changed files with 48 additions and 99 deletions

View File

@@ -50,14 +50,14 @@ local function parseMarketEnter(protocol, msg)
vocation = msg:getU8() -- get vocation id
end
local offers = msg:getU8()
local depotItems = {}
local depotItems = {}
local depotCount = msg:getU16()
for i = 1, depotCount do
local itemId = msg:getU16() -- item id
local itemCount = msg:getU16() -- item count
table.insert(depotItems, {itemId, itemCount})
depotItems[itemId] = itemCount
end
signalcall(Market.onMarketEnter, depotItems, offers, balance, vocation)