mirror of
https://gitlab.com/rubenwardy/awards.git
synced 2024-11-26 01:03:47 +01:00
Fix locked awards not taking difficulty into account
This commit is contained in:
parent
7d462c6aa5
commit
0ae58ad0c3
4
gui.lua
4
gui.lua
@ -34,12 +34,12 @@ local function order_awards(name)
|
|||||||
for _, def in pairs(awards.registered_awards) do
|
for _, def in pairs(awards.registered_awards) do
|
||||||
if not hash_is_unlocked[def.name] and def:can_unlock(data) then
|
if not hash_is_unlocked[def.name] and def:can_unlock(data) then
|
||||||
local started = false
|
local started = false
|
||||||
local score
|
local score = def.difficulty or 1
|
||||||
if def.secret then
|
if def.secret then
|
||||||
score = 1000000
|
score = 1000000
|
||||||
elseif def.trigger and def.trigger.target and def.getProgress then
|
elseif def.trigger and def.trigger.target and def.getProgress then
|
||||||
local progress = def:getProgress(data).perc
|
local progress = def:getProgress(data).perc
|
||||||
score = (1 - progress) * def.trigger.target
|
score = score * (1 - progress) * def.trigger.target
|
||||||
if progress < 0.001 then
|
if progress < 0.001 then
|
||||||
score = score + 100
|
score = score + 100
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user