summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-09-04 00:02:39 +0800
committerscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-09-04 00:02:39 +0800
commit1d79f93affaf93c29cdc89bcc123441d04c1496d (patch)
treeecb851f3e5cacaed2beecc7550c36fba7ddfc1a7
parentcf12c67f29ef452feef6c9426671c108f0c717e8 (diff)
downloadpttbbs-1d79f93affaf93c29cdc89bcc123441d04c1496d.tar
pttbbs-1d79f93affaf93c29cdc89bcc123441d04c1496d.tar.gz
pttbbs-1d79f93affaf93c29cdc89bcc123441d04c1496d.tar.bz2
pttbbs-1d79f93affaf93c29cdc89bcc123441d04c1496d.tar.lz
pttbbs-1d79f93affaf93c29cdc89bcc123441d04c1496d.tar.xz
pttbbs-1d79f93affaf93c29cdc89bcc123441d04c1496d.tar.zst
pttbbs-1d79f93affaf93c29cdc89bcc123441d04c1496d.zip
Fix last commit: time calculating considered "counting mode"
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3127 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/chess.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/mbbsd/chess.c b/mbbsd/chess.c
index c44b669f..b50ade04 100644
--- a/mbbsd/chess.c
+++ b/mbbsd/chess.c
@@ -223,9 +223,12 @@ ChessStepMade(ChessInfo* info, int who)
{
if (!info->timelimit)
info->lefttime[who] = info->constants->traditional_timeout;
- else if (info->lefthand[who])
- info->lefthand[who]--;
- else if (info->lefthand[who] == 0 && info->lefttime[who] <= 0) {
+ else if (
+ (info->lefthand[who] && (--(info->lefthand[who]) == 0) &&
+ info->timelimit->time_mode == CHESS_TIMEMODE_COUNTING)
+ ||
+ (info->lefthand[who] == 0 && info->lefttime[who] <= 0)
+ ) {
info->lefthand[who] = info->timelimit->limit_hand;
info->lefttime[who] = info->timelimit->limit_time;
}