Skip to content

Commit 57f4296

Browse files
authored
Merge pull request #61 from LoganDark/qualityfix4
Fix vanilla legendary quality level, fix crash when removing qualities from the game
2 parents fb5a103 + cf6b302 commit 57f4296

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

control.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ end
3333

3434
table.sort(quality_list, function(a, b) return a.level <= b.level end)
3535

36-
-- normal, uncommon, rare, epic, legendary
37-
local vanilla_quality_multipliers = {1, 2.1, 4.8, 10.5, 35}
36+
-- normal, uncommon, rare, epic, (unused in vanilla), legendary
37+
local vanilla_quality_multipliers = {1, 2.1, 4.8, 10.5, 22, 35}
3838

3939
local function get_quality_multiplier(level) -- level is 1 indexed (1 = normal, 2 = uncommon, ...)
4040
if type(level) == "string" then
4141
level = quality_lookup_by_name[level].level + 1
4242
end
4343

44-
if level <= 5 then
44+
if level <= 6 then
4545
return vanilla_quality_multipliers[level]
4646
else
47-
return 35 * 3^(level - 5)
47+
return 35 * 3^(level - 6)
4848
end
4949
end
5050

@@ -548,7 +548,7 @@ local function update_menu_trader( player, player_mem, update_orders )
548548
gui3.add_item(proto.localised_name)
549549
end
550550

551-
gui3.selected_index = quality_list[quality_lookup_by_level[quality - 1]]
551+
gui3.selected_index = quality_list[quality_lookup_by_level[quality - 1]] or 1
552552
end
553553
end
554554

0 commit comments

Comments
 (0)