diff options
author | gumi <git@gumi.ca> | 2019-08-17 14:15:38 -0400 |
---|---|---|
committer | gumi <git@gumi.ca> | 2020-02-25 13:07:07 -0500 |
commit | 98a8a9e6da2bc13c6283b1e4c1be518290051890 (patch) | |
tree | fa179f11e2ecd889386776a62cacb9165cb069c4 /src | |
parent | 5baa2433dd5a2d7256fd5ba00d6d6b0471066fe4 (diff) | |
download | evol-hercules-98a8a9e6da2bc13c6283b1e4c1be518290051890.tar.gz evol-hercules-98a8a9e6da2bc13c6283b1e4c1be518290051890.tar.bz2 evol-hercules-98a8a9e6da2bc13c6283b1e4c1be518290051890.tar.xz evol-hercules-98a8a9e6da2bc13c6283b1e4c1be518290051890.zip |
remove magic numbers from online list and add support for 3rd gender
Diffstat (limited to 'src')
-rw-r--r-- | src/emap/map.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/emap/map.c b/src/emap/map.c index 9b38045..ad5033e 100644 --- a/src/emap/map.c +++ b/src/emap/map.c @@ -30,6 +30,7 @@ #include "emap/data/mobd.h" #include "emap/data/npcd.h" #include "emap/data/session.h" +#include "emap/enum/beingflag.h" #include "emap/struct/itemdext.h" #include "emap/struct/mapdext.h" #include "emap/struct/mobdext.h" @@ -144,15 +145,18 @@ void emap_online_list(int fd) continue; uint8 state = data->state; - if (sd->status.sex == 1) - state |= 128; + + if (sd->status.sex == SEX_MALE) + state = (state | BEINGFLAG_GENDER_MALE) & ~BEINGFLAG_GENDER_HIDDEN; + else if (sd->status.sex == SEX_FEMALE) + state &= ~(BEINGFLAG_GENDER_MALE | BEINGFLAG_GENDER_HIDDEN); else - state = (state | 128) ^ 128; + state = (state | BEINGFLAG_GENDER_HIDDEN) & ~BEINGFLAG_GENDER_MALE; if (pc_has_permission(sd, permission_send_gm_flag)) - state |= 64; + state |= BEINGFLAG_GM; else - state = (state | 64) ^ 64; + state ^= BEINGFLAG_GM; *ptr = state; ptr ++; |