diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-02-15 23:22:30 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-02-15 23:22:30 +0000 |
commit | 8d048f50359a01b56e1224ff8664f0a22ee8821d (patch) | |
tree | 296aec007df47ae42975ab878a7cbf4af70fad2a /src/map/clif.c | |
parent | eea2f3a5d61f2235381614fee2e9983bcffa4e73 (diff) | |
download | hercules-8d048f50359a01b56e1224ff8664f0a22ee8821d.tar.gz hercules-8d048f50359a01b56e1224ff8664f0a22ee8821d.tar.bz2 hercules-8d048f50359a01b56e1224ff8664f0a22ee8821d.tar.xz hercules-8d048f50359a01b56e1224ff8664f0a22ee8821d.zip |
- Cleaned up clif_party_info a bit
- Reverted some of my mobdb code
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9870 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 26312a138..9a7d941f2 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -5739,10 +5739,10 @@ int clif_party_join_info(struct party *p, struct map_session_data *sd) * Sends party information * R 00fb <len>.w <party name>.24B {<ID>.l <nick>.24B <map name>.16B <leader>.B <offline>.B}.46B* *------------------------------------------*/ -int clif_party_info(struct party_data* p, int fd) +int clif_party_info(struct party_data* p, struct map_session_data *sd) { unsigned char buf[2+2+NAME_LENGTH+(4+NAME_LENGTH+MAP_NAME_LENGTH+1+1)*MAX_PARTY]; - struct map_session_data* sd = NULL; + struct map_session_data* party_sd = NULL; int i, c; nullpo_retr(0, p); @@ -5754,7 +5754,7 @@ int clif_party_info(struct party_data* p, int fd) struct party_member* m = &p->party.member[i]; if(!m->account_id) continue; - if(sd == NULL) sd = p->data[i].sd; // need at least one member's 'sd' so clif_send() can identify the party + if(party_sd == NULL) party_sd = p->data[i].sd; WBUFL(buf,28+c*46) = m->account_id; memcpy(WBUFP(buf,28+c*46+4), m->name, NAME_LENGTH); @@ -5765,12 +5765,10 @@ int clif_party_info(struct party_data* p, int fd) } WBUFW(buf,2) = 28+c*46; - if(fd >= 0) { // send only to self - if (session[fd] && session[fd]->session_data) - clif_send(buf, WBUFW(buf,2), &((struct map_session_data *)session[fd]->session_data)->bl, SELF); - } else { // send to whole party - if(sd) - clif_send(buf, WBUFW(buf,2), &sd->bl, PARTY); + if(sd) { // send only to self + clif_send(buf, WBUFW(buf,2), &sd->bl, SELF); + } else if (party_sd) { // send to whole party + clif_send(buf, WBUFW(buf,2), &party_sd->bl, PARTY); } return 0; |