diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-12-26 15:07:18 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-12-26 15:07:18 +0000 |
commit | 5abd5bd1f8f53b73560cecd4496bfd4bc2acc226 (patch) | |
tree | 1599a2cfc0f4079ce75a649e04542bdc1d8d06d7 /src/map/clif.c | |
parent | 391ac7a8a4aedafe818d0559a2011722fa54163c (diff) | |
download | hercules-5abd5bd1f8f53b73560cecd4496bfd4bc2acc226.tar.gz hercules-5abd5bd1f8f53b73560cecd4496bfd4bc2acc226.tar.bz2 hercules-5abd5bd1f8f53b73560cecd4496bfd4bc2acc226.tar.xz hercules-5abd5bd1f8f53b73560cecd4496bfd4bc2acc226.zip |
- Cleaned up some more the code so it works for -DTURBO
- Cleaned the pvpoff @ and script commands.
- mob_get_random_id now has two additional flags to specify that the monster to acquire should not be a boss type (4) or that it should give exp (8).
- TK_MISSION will now pick any mob from the DB as long as it is not a boss type and it gives base exp.
- Fixed the double-stone issue when hitting a petrified character.
- Minor cleanups
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9573 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 56 |
1 files changed, 25 insertions, 31 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 87389d29b..937509fa6 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -5182,15 +5182,15 @@ int clif_set0199(int fd,int type) */ int clif_pvpset(struct map_session_data *sd,int pvprank,int pvpnum,int type) { - nullpo_retr(0, sd); + int fd = sd->fd; if(type == 2) { - WFIFOHEAD(sd->fd,packet_len(0x19a)); - WFIFOW(sd->fd,0) = 0x19a; - WFIFOL(sd->fd,2) = sd->bl.id; - WFIFOL(sd->fd,6) = pvprank; - WFIFOL(sd->fd,10) = pvpnum; - WFIFOSET(sd->fd,packet_len(0x19a)); + WFIFOHEAD(fd,packet_len(0x19a)); + WFIFOW(fd,0) = 0x19a; + WFIFOL(fd,2) = sd->bl.id; + WFIFOL(fd,6) = pvprank; + WFIFOL(fd,10) = pvpnum; + WFIFOSET(fd,packet_len(0x19a)); } else { unsigned char buf[32]; WBUFW(buf,0) = 0x19a; @@ -5971,27 +5971,21 @@ int clif_party_option(struct party_data *p,struct map_session_data *sd,int flag) nullpo_retr(0, p); -// if(battle_config.etc_log) -// printf("clif_party_option: %d %d %d\n",p->exp,p->item,flag); - if(sd==NULL && flag==0){ + if(!sd && flag==0){ int i; for(i=0;i<MAX_PARTY && !p->data[i].sd;i++); if (i < MAX_PARTY) sd = p->data[i].sd; } - if(sd==NULL) - return 0; + if(!sd) return 0; WBUFW(buf,0)=0x101; // WBUFL(buf,2) // that's how the client reads it, still need to check it's uses [FlavioJS] WBUFW(buf,2)=((flag&0x01)?2:p->party.exp); - WBUFW(buf,4)=0; //NOTE: We don't know yet what this is for, it is NOT for item share rules, though. [Skotlex] + WBUFW(buf,4)=0; if(flag==0) clif_send(buf,packet_len(0x101),&sd->bl,PARTY); - else { - WFIFOHEAD(sd->fd,packet_len(0x101)); - memcpy(WFIFOP(sd->fd,0),buf,packet_len(0x101)); - WFIFOSET(sd->fd,packet_len(0x101)); - } + else + clif_send(buf,packet_len(0x101),&sd->bl,SELF); return 0; } /*========================================== @@ -6005,24 +5999,24 @@ int clif_party_leaved(struct party_data *p,struct map_session_data *sd,int accou nullpo_retr(0, p); + if(!sd && (flag&0xf0)==0) + { + for(i=0;i<MAX_PARTY && !p->data[i].sd;i++); + if (i < MAX_PARTY) + sd = p->data[i].sd; + } + + if(!sd) return 0; + WBUFW(buf,0)=0x105; WBUFL(buf,2)=account_id; memcpy(WBUFP(buf,6),name,NAME_LENGTH); WBUFB(buf,30)=flag&0x0f; - if((flag&0xf0)==0){ - if(sd==NULL) { - for(i=0;i<MAX_PARTY && !p->data[i].sd;i++); - if (i < MAX_PARTY) - sd = p->data[i].sd; - } - if (sd) - clif_send(buf,packet_len(0x105),&sd->bl,PARTY); - } else if (sd!=NULL) { - WFIFOHEAD(sd->fd,packet_len(0x105)); - memcpy(WFIFOP(sd->fd,0),buf,packet_len(0x105)); - WFIFOSET(sd->fd,packet_len(0x105)); - } + if((flag&0xf0)==0) + clif_send(buf,packet_len(0x105),&sd->bl,PARTY); + else + clif_send(buf,packet_len(0x105),&sd->bl,SELF); return 0; } /*========================================== |