summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-30 10:09:41 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-30 10:09:41 +0800
commit19b4b58535cbc2f357ab41c30212b23e78cefc69 (patch)
tree63093f95556d26381a7cb90a533e2eb69db25c71 /mbbsd
parent24bd774a0b26c4929bc7d8a792928888a3c04669 (diff)
downloadpttbbs-19b4b58535cbc2f357ab41c30212b23e78cefc69.tar
pttbbs-19b4b58535cbc2f357ab41c30212b23e78cefc69.tar.gz
pttbbs-19b4b58535cbc2f357ab41c30212b23e78cefc69.tar.bz2
pttbbs-19b4b58535cbc2f357ab41c30212b23e78cefc69.tar.lz
pttbbs-19b4b58535cbc2f357ab41c30212b23e78cefc69.tar.xz
pttbbs-19b4b58535cbc2f357ab41c30212b23e78cefc69.tar.zst
pttbbs-19b4b58535cbc2f357ab41c30212b23e78cefc69.zip
- chicken: make sysop revive and user revive work in same way
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4261 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/chicken.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/mbbsd/chicken.c b/mbbsd/chicken.c
index 50c49d48..053b09a0 100644
--- a/mbbsd/chicken.c
+++ b/mbbsd/chicken.c
@@ -824,6 +824,22 @@ select_menu(int age, chicken_t *mychicken)
}
static int
+revive_chicken(chicken_t *thechicken)
+{
+ assert(thechicken);
+
+ strlcpy(thechicken->name, "[撿回來的]", sizeof(thechicken->name));
+ thechicken->hp = thechicken->hp_max;
+ thechicken->sick = 0;
+ thechicken->satis = 2;
+ thechicken->tiredstrong = 0;
+ thechicken->weight = thechicken->hp;
+ thechicken->lastvisit = now; // really need so?
+
+ return 0;
+}
+
+static int
recover_chicken(chicken_t * thechicken)
{
char buf[200];
@@ -856,13 +872,7 @@ recover_chicken(chicken_t * thechicken)
igetch();
return 0;
}
- strlcpy(thechicken->name, "[撿回來的]", sizeof(thechicken->name));
- thechicken->hp = thechicken->hp_max;
- thechicken->sick = 0;
- thechicken->satis = 2;
- thechicken->tiredstrong = 0;
- thechicken->weight = thechicken->hp;
- // thechicken->lastvisit = now; // really need so?
+ revive_chicken(thechicken);
vice(money, "靈界守衛");
snprintf(buf, sizeof(buf),
ANSI_COLOR(33;44) "★靈界守衛" ANSI_COLOR(37;45)
@@ -905,8 +915,9 @@ chicken_toggle_death(const char *uid)
}
else
{
+ revive_chicken(mychicken);
strlcpy(mychicken->name, "[死]", sizeof(mychicken->name));
- mychicken->lastvisit = now; // prevent suddent death
+ // mychicken->lastvisit = now; // prevent suddent death (now done in revive_chicken)
vmsgf("%s 的寵物復活了", uid);
}
free_live_chicken(mychicken);