diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-03-14 18:14:55 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-03-14 18:14:55 +0800 |
commit | 3b920f88afea0e1bd107610afd21cf21622b0209 (patch) | |
tree | d3e411d0d21ec42b847b1ab02de9f8ad84cd0281 | |
parent | 30aaf378e0410c941dd7d7043aac0505ef44e2e1 (diff) | |
download | pttbbs-3b920f88afea0e1bd107610afd21cf21622b0209.tar pttbbs-3b920f88afea0e1bd107610afd21cf21622b0209.tar.gz pttbbs-3b920f88afea0e1bd107610afd21cf21622b0209.tar.bz2 pttbbs-3b920f88afea0e1bd107610afd21cf21622b0209.tar.lz pttbbs-3b920f88afea0e1bd107610afd21cf21622b0209.tar.xz pttbbs-3b920f88afea0e1bd107610afd21cf21622b0209.tar.zst pttbbs-3b920f88afea0e1bd107610afd21cf21622b0209.zip |
fix bugs
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@25 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/mbbsd.c | 7 | ||||
-rw-r--r-- | mbbsd/talk.c | 19 |
2 files changed, 18 insertions, 8 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 3a38aabb..975e2b3c 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -1,4 +1,4 @@ -/* $Id: mbbsd.c,v 1.6 2002/03/14 08:17:45 in2 Exp $ */ +/* $Id: mbbsd.c,v 1.7 2002/03/14 10:14:55 in2 Exp $ */ #include <stdio.h> #include <string.h> #include <stdlib.h> @@ -443,8 +443,9 @@ write_request (int sig) watermode == -1 ){ /* 不在回水球模式 */ do{ add_history(&currutmp->msgs[0]); - for (i = 0; i < currutmp->msgcount; i++) - currutmp->msgs[i] = currutmp->msgs[i + 1]; + if( currutmp->msgcount-- ) + for (i = 0; i < currutmp->msgcount; i++) + currutmp->msgs[i] = currutmp->msgs[i + 1]; } while (currutmp->msgcount); currutmp->msgcount = 0; diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 5edf29a0..8bf45197 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -1,4 +1,4 @@ -/* $Id: talk.c,v 1.7 2002/03/14 08:17:45 in2 Exp $ */ +/* $Id: talk.c,v 1.8 2002/03/14 10:14:55 in2 Exp $ */ #include <stdio.h> #include <string.h> #include <errno.h> @@ -456,9 +456,14 @@ void water_scr(water_t *tw, int which, char type) else prints("\033[0m \n"); } + + move(21, 4);prints(" "); + move(21, 4); + prints("\033[0m \033[1;37;46m%-66s\033[0m \n", + tw->msg[5].last_call_in); + move(0, 0);prints(" "); - move(0, 0); - prints("\033[0m反擊 %s:", tw->userid); + move(0, 0);prints("\033[0m反擊 %s:", tw->userid); clrtoeol(); move(0, strlen(tw->userid) + 6); } @@ -508,9 +513,11 @@ void my_write2(void) move(22, 4); prints(" \033[1;35m◇\033[1;36m────────────────" "─────────────────\033[1;35m◇\033[0m "); + /* move(21, 4);prints(" "); move(21, 4); prints("\033[0m \033[1;37;46m%-66s\033[0m \n", t_last_write); + */ water_scr(swater[0], 0, 1); refresh(); @@ -560,7 +567,9 @@ void my_write2(void) 80-strlen(tw->userid)-6, DOECHO) ) break; - my_write(tw->pid, msg, tw->userid, 4, tw->uin); + if( my_write(tw->pid, msg, tw->userid, 4, tw->uin) ) + strncpy(tw->msg[5].last_call_in, t_last_write, + sizeof(tw->msg[5].last_call_in)); break; } } while( !done ); @@ -701,7 +710,7 @@ int my_write(pid_t pid, char *prompt, char *id, int flag, userinfo_t *puin) } else if (flag != 2) outmsg("\033[1;33;41m糟糕! 對方不行了! (收到太多水球) \033[37m@_@\033[m"); - if(uin->msgcount == 1 && (uin->pid <= 0 || kill(uin->pid, SIGUSR2) == -1) && flag != 2) + if(uin->msgcount >= 1 && (uin->pid <= 0 || kill(uin->pid, SIGUSR2) == -1) && flag != 2) outmsg("\033[1;33;41m糟糕! 沒打中! \033[37m~>_<~\033[m"); else if(uin->msgcount == 1 && flag != 2) outmsg("\033[1;33;44m水球砸過去了! \033[37m*^o^*\033[m"); |