Skip to content

Commit

Permalink
Merge branch 'develop' into expanse_update
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerkiz authored Aug 18, 2022
2 parents 48142ad + b6b2f4a commit c5018a5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions maps/mountain_fortress_v3/basic_markets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,13 @@ function Public.shuffle_prices()
this.market_default_settings = table.deepcopy(this.market_settings)
end

for _, data in pairs(this.market_settings) do
for market_index, data in pairs(this.market_settings) do
local ref_data = this.market_default_settings[market_index]
if data and type(data) == 'table' then
for _, category in pairs(data) do
local max = math.round(category.value * 1.5)
local min = math.round(category.value * 0.5)
for recipe_index, category in pairs(data) do
local ref_category = ref_data[recipe_index]
local max = math.round(ref_category.value * 1.5)
local min = math.round(ref_category.value * 0.5)
local v = random(min, max)
if v then
category.value = v
Expand Down

0 comments on commit c5018a5

Please sign in to comment.