summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/sys/sort.c3
-rw-r--r--include/pttstruct.h4
-rw-r--r--mbbsd/talk.c2
-rw-r--r--mbbsd/user.c21
4 files changed, 25 insertions, 5 deletions
diff --git a/common/sys/sort.c b/common/sys/sort.c
index d649b9e4..78b0af2d 100644
--- a/common/sys/sort.c
+++ b/common/sys/sort.c
@@ -7,7 +7,8 @@ int cmp_int(const void *a, const void *b)
int cmp_int_desc(const void * a, const void * b)
{
- return cmp_int(b, a);
+ // return cmp_int(b, a);
+ return *(int*)b - *(int*)a;
}
int *
diff --git a/include/pttstruct.h b/include/pttstruct.h
index cc766a40..d3bc6602 100644
--- a/include/pttstruct.h
+++ b/include/pttstruct.h
@@ -310,14 +310,14 @@ typedef struct userinfo_t {
char from[27]; /* machine name the user called in from */
int from_alias;
char sex;
- char nonuse[5];
+ char nonuse[4];
/*
unsigned char goodpost;
unsigned char badpost;
unsigned char goodsale;
unsigned char badsale;
- unsigned char angel; // deprecated: angel reject status
*/
+ unsigned char angelpause;
/* friends */
int friendtotal; /* 好友比較的cache 大小 */
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index e3134f59..7b7c6d71 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -3607,7 +3607,7 @@ TalkToAngel(){
}
uent = search_ulist_userid(cuser.myangel);
- if (uent == 0 || he_reject_me(uent)){
+ if (uent == 0 || uent->angelpause || he_reject_me(uent)){
AngelNotOnline();
return;
}
diff --git a/mbbsd/user.c b/mbbsd/user.c
index 90959c00..88e1fffb 100644
--- a/mbbsd/user.c
+++ b/mbbsd/user.c
@@ -426,6 +426,15 @@ void Customize(void)
'1' + iax++,
"目前的心情",
mindbuf);
+#ifdef PLAY_ANGEL
+ if (HasUserPerm(PERM_ANGEL))
+ {
+ prints("%c. %-40s%s\n",
+ '1' + iax++,
+ "開放小主人詢問",
+ (currutmp->angelpause ? "否" : "是"));
+ }
+#endif // PLAY_ANGEL
}
/* input */
@@ -482,7 +491,17 @@ void Customize(void)
}
continue;
}
-
+#ifdef PLAY_ANGEL
+ if( HasUserPerm(PERM_ANGEL) ){
+ if (key == iax-1)
+ {
+ // SwitchBeingAngel();
+ currutmp->angelpause = !currutmp->angelpause;
+ dirty = 1;
+ continue;
+ }
+ }
+#endif //PLAY_ANGEL
}
grayout(1, b_lines-2, GRAYOUT_DARK);