Skip to content

Commit

Permalink
Mtn v3 - fix bad boo boo
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerkiz committed Aug 18, 2022
1 parent 734bf54 commit b1dd8f9
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
@@ -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

0 comments on commit b1dd8f9

Please sign in to comment.