From 8ba23dd99f7c09a6b89bbcbae7b6e72f46447b4a Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Mon, 6 Dec 2010 12:12:53 +0000 Subject: [PATCH] Bug Fix for issue 464, multipling the secs you set to interrupt by the amount of unresolved stack actions. this extends you time giving you essentially X sec of interrupt offer for each stack action. exsample, 3 unresolved stack actions. with interrupt set to 5 secs, will allot you 15 secs to decide the first action, then 10 secs to decide the 2nd action, then 5 secs to decide the last action. note: its multiplicative, this does not make each stack action into 15 sec interrupt. as they resolve "extraTime" gets recalculated. --- projects/mtg/src/ActionStack.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/projects/mtg/src/ActionStack.cpp b/projects/mtg/src/ActionStack.cpp index 5db57f168..fd66464a4 100644 --- a/projects/mtg/src/ActionStack.cpp +++ b/projects/mtg/src/ActionStack.cpp @@ -823,8 +823,17 @@ void ActionStack::Update(float dt) // game will wait for ever for the user to make a selection. if (options[Options::INTERRUPT_SECONDS].number > 0) { + int extraTime = 0; + //extraTime is a multiplier, it counts the number of unresolved stack actions + //then is used to extend the time you have to interupt. + //this prevents you from "running out of time" while deciding. + //before this int was added, it was possible to run out of time if you had 10 stack actions + //and set the timer to 4 secs. BUG FIX //http://code.google.com/p/wagic/issues/detail?id=464 + extraTime = count(NULL,NOT_RESOLVED,NULL); + if(extraTime == 0) + extraTime = 1;//we never want this int to be 0. if (timer < 0) - timer = options[Options::INTERRUPT_SECONDS].number; + timer = options[Options::INTERRUPT_SECONDS].number * extraTime; timer -= dt; if (timer < 0) cancelInterruptOffer();