Skip to content

Commit

Permalink
Merge pull request #300 from ComfyFactory/mtn_v3_fix
Browse files Browse the repository at this point in the history
Mtn v3 - fix bad boo boo
  • Loading branch information
Gerkiz authored Aug 18, 2022
2 parents 734bf54 + b1dd8f9 commit b6b2f4a
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 b6b2f4a

Please sign in to comment.