From 19b4b58535cbc2f357ab41c30212b23e78cefc69 Mon Sep 17 00:00:00 2001 From: piaip Date: Wed, 30 Apr 2008 02:09:41 +0000 Subject: - 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 --- mbbsd/chicken.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'mbbsd/chicken.c') diff --git a/mbbsd/chicken.c b/mbbsd/chicken.c index 50c49d48..053b09a0 100644 --- a/mbbsd/chicken.c +++ b/mbbsd/chicken.c @@ -823,6 +823,22 @@ select_menu(int age, chicken_t *mychicken) return 1; } +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) { @@ -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); -- cgit v1.2.3