From 5b981f638f4dc7b3fa0783552dabf3d588f81a72 Mon Sep 17 00:00:00 2001 From: Vicious Date: Tue, 18 Apr 2006 03:38:19 +0000 Subject: better way to fix invisible npc! :D git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6146 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/clif.c | 62 ++++++++++++++++++++++------------------------------------ 1 file changed, 23 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/map/clif.c b/src/map/clif.c index 18b09da95..1d2674ebb 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -1705,6 +1705,9 @@ int clif_scriptclose(struct map_session_data *sd, int npcid) { WFIFOW(fd,0)=0xb6; WFIFOL(fd,2)=npcid; WFIFOSET(fd,packet_len_table[0xb6]); + + if(map_id2bl(npcid)->m < 0) + clif_clearchar_id(npcid, 0, fd); return 0; } @@ -1736,22 +1739,15 @@ int clif_scriptmenu(struct map_session_data *sd, int npcid, char *mes) { fd=sd->fd; - if(map_id2bl(npcid)->m < 0){ + if(map_id2bl(npcid)->m < 0) send_fake_npc(sd, npcid); - WFIFOW(fd,0)=0xb7; - WFIFOW(fd,2)=slen; - WFIFOL(fd,4)=npcid; - strcpy((char*)WFIFOP(fd,8),mes); - WFIFOSET(fd,WFIFOW(fd,2)); - clif_clearchar_id(npcid, 0, fd); - } else { - WFIFOW(fd,0)=0xb7; - WFIFOW(fd,2)=slen; - WFIFOL(fd,4)=npcid; - strcpy((char*)WFIFOP(fd,8),mes); - WFIFOSET(fd,WFIFOW(fd,2)); - } + WFIFOW(fd,0)=0xb7; + WFIFOW(fd,2)=slen; + WFIFOL(fd,4)=npcid; + strcpy((char*)WFIFOP(fd,8),mes); + WFIFOSET(fd,WFIFOW(fd,2)); + return 0; } @@ -1765,19 +1761,13 @@ int clif_scriptinput(struct map_session_data *sd, int npcid) { nullpo_retr(0, sd); fd=sd->fd; - if(map_id2bl(npcid)->m < 0){ + if(map_id2bl(npcid)->m < 0) send_fake_npc(sd, npcid); - WFIFOHEAD(fd, packet_len_table[0x142]); - WFIFOW(fd,0)=0x142; - WFIFOL(fd,2)=npcid; - WFIFOSET(fd,packet_len_table[0x142]); - clif_clearchar_id(npcid, 0, fd); - } else { - WFIFOHEAD(fd, packet_len_table[0x142]); - WFIFOW(fd,0)=0x142; - WFIFOL(fd,2)=npcid; - WFIFOSET(fd,packet_len_table[0x142]); - } + + WFIFOHEAD(fd, packet_len_table[0x142]); + WFIFOW(fd,0)=0x142; + WFIFOL(fd,2)=npcid; + WFIFOSET(fd,packet_len_table[0x142]); return 0; } @@ -1792,20 +1782,14 @@ int clif_scriptinputstr(struct map_session_data *sd, int npcid) { nullpo_retr(0, sd); fd=sd->fd; - if(map_id2bl(npcid)->m < 0){ + if(map_id2bl(npcid)->m < 0) send_fake_npc(sd, npcid); - WFIFOHEAD(fd, packet_len_table[0x1d4]); - WFIFOW(fd,0)=0x1d4; - WFIFOL(fd,2)=npcid; - WFIFOSET(fd,packet_len_table[0x1d4]); - clif_clearchar_id(npcid, 0, fd); - } else { - WFIFOHEAD(fd, packet_len_table[0x1d4]); - WFIFOW(fd,0)=0x1d4; - WFIFOL(fd,2)=npcid; - WFIFOSET(fd,packet_len_table[0x1d4]); - } - + + WFIFOHEAD(fd, packet_len_table[0x1d4]); + WFIFOW(fd,0)=0x1d4; + WFIFOL(fd,2)=npcid; + WFIFOSET(fd,packet_len_table[0x1d4]); + return 0; } -- cgit v1.2.3-70-g09d2