diff options
author | eathenabot <eathenabot@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-01-17 05:10:45 +0000 |
---|---|---|
committer | eathenabot <eathenabot@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-01-17 05:10:45 +0000 |
commit | f5ded9b1d612e0b21ca993303289cffa8aae9180 (patch) | |
tree | b448e656b9dc76b9bebfd4df896aacb543fc96d1 /src/map | |
parent | 147d068dc417591b39755c627e7b957db1b9d9e2 (diff) | |
download | hercules-f5ded9b1d612e0b21ca993303289cffa8aae9180.tar.gz hercules-f5ded9b1d612e0b21ca993303289cffa8aae9180.tar.bz2 hercules-f5ded9b1d612e0b21ca993303289cffa8aae9180.tar.xz hercules-f5ded9b1d612e0b21ca993303289cffa8aae9180.zip |
* Merged changes up to eAthena 15053. [ai4rei]
- clif cleanup: Changed clif_changestatus so that it takes sd instead of bl, since it only accepts BL_PC bls anyway.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15471 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/clif.c | 21 | ||||
-rw-r--r-- | src/map/clif.h | 2 | ||||
-rw-r--r-- | src/map/pc.c | 2 | ||||
-rw-r--r-- | src/map/status.c | 6 |
4 files changed, 14 insertions, 17 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 1681294ed..fc859497f 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2726,30 +2726,27 @@ void clif_updatestatus(struct map_session_data *sd,int type) WFIFOSET(fd,len); } -void clif_changestatus(struct block_list *bl,int type,int val) +void clif_changestatus(struct map_session_data* sd,int type,int val) { unsigned char buf[12]; - struct map_session_data *sd = NULL; - nullpo_retv(bl); + nullpo_retv(sd); - if(bl->type == BL_PC) - sd = (struct map_session_data *)bl; + WBUFW(buf,0)=0x1ab; + WBUFL(buf,2)=sd->bl.id; + WBUFW(buf,6)=type; - if(sd){ - WBUFW(buf,0)=0x1ab; - WBUFL(buf,2)=bl->id; - WBUFW(buf,6)=type; - switch(type){ + switch(type) + { case SP_MANNER: WBUFL(buf,8)=val; break; default: ShowError("clif_changestatus : unrecognized type %d.\n",type); return; - } - clif_send(buf,packet_len(0x1ab),bl,AREA_WOS); } + + clif_send(buf,packet_len(0x1ab),&sd->bl,AREA_WOS); } /*========================================== diff --git a/src/map/clif.h b/src/map/clif.h index 2af57c69e..cf6578c5c 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -255,7 +255,7 @@ void clif_additem(struct map_session_data *sd, int n, int amount, int fail); // void clif_dropitem(struct map_session_data *sd,int n,int amount); //self void clif_delitem(struct map_session_data *sd,int n,int amount, short reason); //self void clif_updatestatus(struct map_session_data *sd,int type); //self -void clif_changestatus(struct block_list* bl,int type,int val); //area +void clif_changestatus(struct map_session_data* sd,int type,int val); //area int clif_damage(struct block_list* src, struct block_list* dst, unsigned int tick, int sdelay, int ddelay, int damage, int div, int type, int damage2); // area void clif_takeitem(struct block_list* src, struct block_list* dst); void clif_sitting(struct block_list* bl); diff --git a/src/map/pc.c b/src/map/pc.c index b2f948180..6f10e88a7 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -6677,7 +6677,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper) merc_hom_vaporize(sd, 0); if(sd->status.manner < 0) - clif_changestatus(&sd->bl,SP_MANNER,sd->status.manner); + clif_changestatus(sd,SP_MANNER,sd->status.manner); status_calc_pc(sd,0); pc_checkallowskill(sd); diff --git a/src/map/status.c b/src/map/status.c index dfde3dfd2..5b10f1deb 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -6230,7 +6230,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val val1 = battle_config.manner_system; //Mute filters. if (sd) { - clif_changestatus(&sd->bl,SP_MANNER,sd->status.manner); + clif_changestatus(sd,SP_MANNER,sd->status.manner); clif_updatestatus(sd,SP_MANNER); } break; @@ -7951,7 +7951,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const sd->status.manner = 0; if (sd && tid == INVALID_TIMER) { - clif_changestatus(&sd->bl,SP_MANNER,sd->status.manner); + clif_changestatus(sd,SP_MANNER,sd->status.manner); clif_updatestatus(sd,SP_MANNER); } break; @@ -8647,7 +8647,7 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data) case SC_NOCHAT: if(sd){ sd->status.manner++; - clif_changestatus(bl,SP_MANNER,sd->status.manner); + clif_changestatus(sd,SP_MANNER,sd->status.manner); clif_updatestatus(sd,SP_MANNER); if (sd->status.manner < 0) { //Every 60 seconds your manner goes up by 1 until it gets back to 0. |