From 2cd97f154f781bee35f47d884af47de396a7877e Mon Sep 17 00:00:00 2001 From: shennetsind Date: Fri, 17 May 2013 16:45:56 -0300 Subject: Fixed Bug #7171 Item #2 http://hercules.ws/board/tracker/issue-7171-fontcolor-error/ Special Thanks to Beret~! Signed-off-by: shennetsind --- src/map/clif.c | 16 +++++++++------- src/map/pc.c | 8 ++++++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index 0c5143ffd..2f69ce2fd 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -1136,9 +1136,9 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) { p.isBoss = 0; } #endif - clif->send(&p,sizeof(p),bl,target); - if( disguised(bl) ) { + if( sd->status.class_ != sd->disguise ) + clif->send(&p,sizeof(p),bl,target); #if PACKETVER >= 20071106 p.objecttype = pcdb_checkid(status_get_viewdata(bl)->class_) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE p.GID = -bl->id; @@ -1146,7 +1146,8 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) { p.GID = -bl->id; #endif clif->send(&p,sizeof(p),bl,SELF); - } + } else + clif->send(&p,sizeof(p),bl,target); } @@ -9836,10 +9837,11 @@ void clif_parse_GetCharNameRequest(int fd, struct map_session_data *sd) } int clif_undisguise_timer(int tid, unsigned int tick, int id, intptr_t data) { struct map_session_data * sd; - if( (sd = map_id2sd(id)) && sd->fontcolor && sd->disguise == sd->status.class_ ) { - pc_disguise(sd,-1); + if( (sd = map_id2sd(id)) ) { + sd->fontcolor_tid = INVALID_TIMER; + if( sd->fontcolor && sd->disguise == sd->status.class_ ) + pc_disguise(sd,-1); } - sd->fontcolor_tid = INVALID_TIMER; return 0; } @@ -9880,10 +9882,10 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd) unsigned char mylen = 1; if( sd->disguise == -1 ) { + sd->fontcolor_tid = add_timer(gettick()+5000, clif->undisguise_timer, sd->bl.id, 0); pc_disguise(sd,sd->status.class_); if( pc_isdead(sd) ) clif_clearunit_single(-sd->bl.id, CLR_DEAD, sd->fd); - sd->fontcolor_tid = add_timer(gettick()+5000, clif->undisguise_timer, sd->bl.id, 0); } else if ( sd->disguise == sd->status.class_ && sd->fontcolor_tid != INVALID_TIMER ) { const struct TimerData *timer; if( (timer = get_timer(sd->fontcolor_tid)) ) { diff --git a/src/map/pc.c b/src/map/pc.c index 644a296cf..55ce993b4 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1642,8 +1642,12 @@ int pc_disguise(struct map_session_data *sd, int class_) { } if (sd->bl.prev != NULL) { - pc_stop_walking(sd, 0); - clif->clearunit_area(&sd->bl, CLR_OUTSIGHT); + if( class_ == -1 && sd->disguise == sd->status.class_ ) { + clif->clearunit_single(-sd->bl.id,CLR_OUTSIGHT,sd->fd); + } else if ( class_ != sd->status.class_ ) { + pc_stop_walking(sd, 0); + clif->clearunit_area(&sd->bl, CLR_OUTSIGHT); + } } if (class_ == -1) { -- cgit v1.2.3-70-g09d2