summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-04-17 22:36:58 +0100
committerrubenwardy <rw@rubenwardy.com>2018-04-17 22:37:09 +0100
commit0ae58ad0c3f99567d34320208d2ca5305d0d161d (patch)
treea773897e159410ac9edf6a38145dc792256c5fe7
parent7d462c6aa5ad327c0675e4c0c894297c063dccbb (diff)
Fix locked awards not taking difficulty into account
-rw-r--r--gui.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/gui.lua b/gui.lua
index 21d0d37..42640f7 100644
--- a/gui.lua
+++ b/gui.lua
@@ -34,12 +34,12 @@ local function order_awards(name)
for _, def in pairs(awards.registered_awards) do
if not hash_is_unlocked[def.name] and def:can_unlock(data) then
local started = false
- local score
+ local score = def.difficulty or 1
if def.secret then
score = 1000000
elseif def.trigger and def.trigger.target and def.getProgress then
local progress = def:getProgress(data).perc
- score = (1 - progress) * def.trigger.target
+ score = score * (1 - progress) * def.trigger.target
if progress < 0.001 then
score = score + 100
else