fix #3513 - if contrib level is NaN, use 0

Fixes (I hope) https://github.com/HabitRPG/habitrpg/issues/3513. NOTE that private code will need to be edited too - ref https://github.com/HabitRPG/habitrpg-shared/commit/f49ed5436c60d6b135909a3c8714347d99499701
This commit is contained in:
Alice Harris
2014-05-22 16:25:08 +10:00
parent 25ce644915
commit c09e06e73a
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1008,7 +1008,7 @@ api.wrap = (user, main=true) ->
user.markModified? 'party.quest.progress'
#console.log {progress:user.party.quest.progress}
return if (api.daysSince(user.items.lastDrop.date, user.preferences) is 0) and (user.items.lastDrop.count >= 5 + Math.floor(user._statsComputed.per / 25) + user.contributor.level)
return if (api.daysSince(user.items.lastDrop.date, user.preferences) is 0) and (user.items.lastDrop.count >= 5 + Math.floor(user._statsComputed.per / 25) + (user.contributor.level or 0))
if user.flags?.dropsEnabled and user.fns.predictableRandom(user.stats.exp) < chance
# current breakdown - 1% (adjustable) chance on drop