"purchase anyway" confirm on too-low-gp purchases

This commit is contained in:
Tyler Renelle
2013-02-13 15:50:49 -05:00
parent ce9e676d1e
commit 2836e84186
+4 -1
View File
@@ -176,8 +176,11 @@ score = (taskId, direction, times, batch, cron) ->
gp -= Math.abs(taskObj.value)
num = parseFloat(taskObj.value).toFixed(2)
# if too expensive, reduce health & zero gp
if gp < 0
hp += gp # hp - gp difference
r = confirm "You don't have enough GP to purchase this reward, purchase anyway and lose health?"
if r
hp += gp # hp - gp difference
gp = 0
taskObj.value = value