From f6750ffc164bb4c163a2ba0b69a4ef42eaee89f0 Mon Sep 17 00:00:00 2001 From: yangit Date: Fri, 14 Jun 2013 15:07:18 +0800 Subject: [PATCH] fix for confirmation window when buying rewards w\o money. --- script/algos.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/script/algos.coffee b/script/algos.coffee index 851eeee1db..3c170ed25f 100644 --- a/script/algos.coffee +++ b/script/algos.coffee @@ -172,7 +172,9 @@ obj.score = (user, task, direction, options={}) -> # If they're trying to purhcase a too-expensive reward, confirm they want to take a hit for it if task.value > user.stats.gp and task.type is 'reward' - return unless confirm "Not enough GP to purchase this reward, buy anyway and lose HP? (Punishment for taking a reward you didn't earn)." +# check if we can show user the confirmation window. If yes, show it. If no, just shut up and do what is requested (for API). + if confirm? + return unless confirm "Not enough GP to purchase this reward, buy anyway and lose HP? (Punishment for taking a reward you didn't earn)." delta = 0 calculateDelta = (adjustvalue = true) ->