drafts for market system. It would be better if I remove the inbox system and market is still working like shit

This commit is contained in:
ErikasKontenis
2022-04-09 21:31:51 +03:00
parent 396464b940
commit f839f0b637
46 changed files with 5402 additions and 506 deletions

View File

@@ -740,6 +740,19 @@ local function onMarketMessage(messageMode, message)
Market.displayMessage(message)
end
local function dump(o)
if type(o) == 'table' then
local s = '{ '
for k,v in pairs(o) do
if type(k) ~= 'number' then k = '"'..k..'"' end
s = s .. '['..k..'] = ' .. dump(v) .. ','
end
return s .. '} '
else
return tostring(o)
end
end
local function initMarketItems(items)
for c = MarketCategory.First, MarketCategory.Last do
marketItems[c] = {}
@@ -768,7 +781,6 @@ local function initMarketItems(items)
tradeAs = entry.id
}
}
-- add new market item
if marketItems[entry.category] ~= nil then
table.insert(marketItems[entry.category], marketItem)