- Added preventing sending packet clif_clearchar_id when the character in question is invisible.

- Added packet 0x7c in clif_spawn which was supposed to be used for non-players.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5869 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-04-02 16:36:07 +00:00
parent ed9f08388d
commit eb6eaff618
2 changed files with 44 additions and 18 deletions

View File

@ -4,6 +4,11 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/04/02 2006/04/02
* Added preventing sending packet clif_clearchar_id when the character in
question is invisible. [Skotlex]
* Added packet 0x7c in clif_spawn which was supposed to be used for
non-players (this fixes pets/mobs/npcs spawning as if they just teleported
into view) [Skotlex]
* Some cleanups to clif.c, removed some excess/broken packets/functions. * Some cleanups to clif.c, removed some excess/broken packets/functions.
[Skotlex] [Skotlex]
* Merged Larry's fix of using a timer to get rid of the glow-issue when you * Merged Larry's fix of using a timer to get rid of the glow-issue when you

View File

@ -1235,8 +1235,10 @@ int clif_spawn(struct block_list *bl)
vd = status_get_viewdata(bl); vd = status_get_viewdata(bl);
if (!vd || vd->class_ == INVISIBLE_CLASS) if (!vd || vd->class_ == INVISIBLE_CLASS)
return 0; return 0;
clif_set0078(bl, vd, buf);
if (pcdb_checkid(vd->class_))
{ //Player spawn packet.
clif_set0078(bl, vd, buf);
#if PACKETVER > 3 #if PACKETVER > 3
if (WBUFW(buf,0)==0x78) { if (WBUFW(buf,0)==0x78) {
WBUFW(buf, 0) = 0x79; WBUFW(buf, 0) = 0x79;
@ -1255,6 +1257,23 @@ int clif_spawn(struct block_list *bl)
} }
#endif #endif
} else { //Mob spawn packet.
struct status_change *sc = status_get_sc(bl);
WBUFW(buf,0)=0x7c;
WBUFL(buf,2)=bl->id;
WBUFW(buf,6)=status_get_speed(bl);
WBUFW(buf,8)=sc?sc->opt1:0;
WBUFW(buf,10)=sc?sc->opt2:0;
WBUFW(buf,12)=sc?sc->option:0;
WBUFW(buf,20)=vd->class_;
WBUFPOS(buf,36,bl->x,bl->y);
clif_send(buf,packet_len_table[0x7c],bl,AREA_WOS);
if (disguised(bl)) {
WBUFL(buf,2)=-bl->id;
clif_send(buf,packet_len_table[0x7c],bl,SELF);
}
}
if (vd->cloth_color) if (vd->cloth_color)
clif_refreshlook(bl,bl->id,LOOK_CLOTHES_COLOR,vd->cloth_color,AREA_WOS); clif_refreshlook(bl,bl->id,LOOK_CLOTHES_COLOR,vd->cloth_color,AREA_WOS);
@ -3906,6 +3925,7 @@ int clif_01ac(struct block_list *bl)
int clif_outsight(struct block_list *bl,va_list ap) int clif_outsight(struct block_list *bl,va_list ap)
{ {
struct block_list *tbl; struct block_list *tbl;
struct view_data *vd;
TBL_PC *sd, *tsd; TBL_PC *sd, *tsd;
tbl=va_arg(ap,struct block_list*); tbl=va_arg(ap,struct block_list*);
if(bl == tbl) return 0; if(bl == tbl) return 0;
@ -3916,6 +3936,7 @@ int clif_outsight(struct block_list *bl,va_list ap)
{ //tsd has lost sight of the bl object. { //tsd has lost sight of the bl object.
switch(bl->type){ switch(bl->type){
case BL_PC: case BL_PC:
if (((TBL_PC*)bl)->vd.class_ != INVISIBLE_CLASS)
clif_clearchar_id(bl->id,0,tsd->fd); clif_clearchar_id(bl->id,0,tsd->fd);
if(sd->chatID){ if(sd->chatID){
struct chat_data *cd; struct chat_data *cd;
@ -3933,14 +3954,14 @@ int clif_outsight(struct block_list *bl,va_list ap)
clif_clearchar_skillunit((struct skill_unit *)bl,tsd->fd); clif_clearchar_skillunit((struct skill_unit *)bl,tsd->fd);
break; break;
default: default:
if (status_get_viewdata(bl)) if ((vd=status_get_viewdata(bl)) && vd->class_ != INVISIBLE_CLASS)
clif_clearchar_id(bl->id,0,tsd->fd); clif_clearchar_id(bl->id,0,tsd->fd);
break; break;
} }
} }
if (sd && sd->fd) if (sd && sd->fd)
{ //sd is watching tbl go out of view. { //sd is watching tbl go out of view.
if (status_get_viewdata(tbl)) if ((vd=status_get_viewdata(tbl)) && vd->class_ != INVISIBLE_CLASS)
clif_clearchar_id(tbl->id,0,sd->fd); clif_clearchar_id(tbl->id,0,sd->fd);
} }
return 0; return 0;