Skip to content

Commit

Permalink
Fixed @fontcolor crashing
Browse files Browse the repository at this point in the history
Special Thanks to Zopokx, Euphy, Fatalis and Frost
http://hercules.ws/board/topic/318-accident-fontcolor/

Signed-off-by: shennetsind <ind@henn.et>
  • Loading branch information
shennetsind committed Apr 5, 2013
1 parent 15c8127 commit 79ab86b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/map/clif.c
Expand Up @@ -233,7 +233,7 @@ uint32 clif_refresh_ip(void) {
#if PACKETVER >= 20071106
static inline unsigned char clif_bl_type(struct block_list *bl) {
switch (bl->type) {
case BL_PC: return disguised(bl) && pcdb_checkid(status_get_viewdata(bl)->class_)? 0x1:0x0; //PC_TYPE
case BL_PC: return (disguised(bl) && !pcdb_checkid(status_get_viewdata(bl)->class_))? 0x1:0x0; //PC_TYPE
case BL_ITEM: return 0x2; //ITEM_TYPE
case BL_SKILL: return 0x3; //SKILL_TYPE
case BL_CHAT: return 0x4; //UNKNOWN_TYPE
Expand Down Expand Up @@ -9711,10 +9711,11 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
WFIFOHEAD(fd,mylen + 12);
WFIFOW(fd,0) = 0x2C1;
WFIFOW(fd,2) = mylen + 12;
WFIFOL(fd,4) = -sd->bl.id;
WFIFOL(fd,4) = sd->bl.id;
WFIFOL(fd,8) = hChSys.colors[sd->fontcolor - 1];
safestrncpy((char*)WFIFOP(fd,12), mout, mylen);
clif->send(WFIFOP(fd,0), WFIFOW(fd,2), &sd->bl, AREA_WOS);
WFIFOL(fd,4) = -sd->bl.id;
WFIFOSET(fd, mylen + 12);
return;
}
Expand Down

4 comments on commit 79ab86b

@euphyy
Copy link
Contributor

@euphyy euphyy commented on 79ab86b Apr 6, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It no longer crashes, but there are still two issues:
-- clif_message displays text inches above the character's head in the default color.
-- @refresh makes the invoking character disappear (similar to @hide).

@shennetsind
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aah i know why the second happens, should be able to fix with ease. the first however is the client's fault, only way i see to fix it would be if we made the server aware of the delay it takes for the color messages to fade away to queue any others in the meantime and then dispatch accordingly, but thats too much trouble for such a cosmetic thing imo.

@shennetsind
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the @refresh in b804926 however I couldn't reproduce the issue with @hide

@euphyy
Copy link
Contributor

@euphyy euphyy commented on 79ab86b Apr 7, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. (It wasn't related to @hide; I was referring to the visual effect.)

Please sign in to comment.