summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2013-03-29 08:53:08 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2013-03-29 08:53:08 +0800
commit81e76ebd07b53b84d8f520025e8b546736df4d4e (patch)
tree01a052b3ab0514797641f8b8bfa1a274a844897d
parent562f3c0d4e3d49549ecb2ba51397a543973e7ab7 (diff)
downloadpttbbs-81e76ebd07b53b84d8f520025e8b546736df4d4e.tar
pttbbs-81e76ebd07b53b84d8f520025e8b546736df4d4e.tar.gz
pttbbs-81e76ebd07b53b84d8f520025e8b546736df4d4e.tar.bz2
pttbbs-81e76ebd07b53b84d8f520025e8b546736df4d4e.tar.lz
pttbbs-81e76ebd07b53b84d8f520025e8b546736df4d4e.tar.xz
pttbbs-81e76ebd07b53b84d8f520025e8b546736df4d4e.tar.zst
pttbbs-81e76ebd07b53b84d8f520025e8b546736df4d4e.zip
fix timesetangel calculation
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5827 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/angel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pttbbs/mbbsd/angel.c b/pttbbs/mbbsd/angel.c
index a093d4a8..a6dc3d1f 100644
--- a/pttbbs/mbbsd/angel.c
+++ b/pttbbs/mbbsd/angel.c
@@ -441,7 +441,7 @@ int angel_check_master(void) {
xuser.userid);
if (xuser.timesetangel)
prints("小天使與主人的關係已維持了 %d 天。\n",
- (now - xuser.timesetangel) / 86400 + 1);
+ (now - xuser.timesetangel) / DAY_SECONDS + 1);
if (xuser.timeplayangel)
prints("小主人最後一次成功\呼叫你(hh)的時間是 %s\n",
Cdatelite(&xuser.timeplayangel));
@@ -463,7 +463,7 @@ angel_log_order_song(const char *angel_nick) {
char angel_exp[STRLEN];
syncnow();
- if (cuser.timesetangel <= now)
+ if (cuser.timesetangel && now >= cuser.timesetangel)
snprintf(angel_exp, sizeof(angel_exp),
"%d天", (now - cuser.timesetangel) / DAY_SECONDS + 1);
else