summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-16 14:57:54 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-16 14:57:54 +0000
commit4ea6ee8aebe0a756ea0bbbc0a33e77faadacdf17 (patch)
treeec76c5f4efc1f9719ba83845c75b47371a11f367
parent2a5e9a504131fb04eb8ffcb6b11a2528a5825dc2 (diff)
downloadhercules-4ea6ee8aebe0a756ea0bbbc0a33e77faadacdf17.tar.gz
hercules-4ea6ee8aebe0a756ea0bbbc0a33e77faadacdf17.tar.bz2
hercules-4ea6ee8aebe0a756ea0bbbc0a33e77faadacdf17.tar.xz
hercules-4ea6ee8aebe0a756ea0bbbc0a33e77faadacdf17.zip
* Sending fake npc for inputs and menus for NPC without map coordinates.
* Fixed npc.h compiler warnings. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6112 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt1
-rw-r--r--src/map/clif.c22
-rw-r--r--src/map/npc.h2
3 files changed, 24 insertions, 1 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 3abd48fed..2567114d7 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -16,6 +16,7 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
[Lance]
* Added warnings to npc_scriptcont for easier debugging. [Lance]
* Missing lines in npc_parse_script! [Lance]
+ * Sending fake npc for inputs and menus for NPC without map coordinates. [Lance]
2006/04/15
* Fixed upgrade_svn5902.sql, thanks to Koshiro for pointing it out.
diff --git a/src/map/clif.c b/src/map/clif.c
index c0304f7b6..c3fa9e347 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -1709,6 +1709,19 @@ int clif_scriptclose(struct map_session_data *sd, int npcid) {
return 0;
}
+void send_fake_npc(struct map_session_data *sd, int npcid){
+ int fd = sd->fd;
+ WFIFOW(fd,0)=0x78;
+ WFIFOL(fd,2)=npcid;
+ WFIFOW(fd,12)=OPTION_INVISIBLE;
+ WFIFOW(fd,14)=INVISIBLE_CLASS;
+ WFIFOPOS(fd,46,sd->bl.x,sd->bl.y);
+ WFIFOB(fd,49)=5;
+ WFIFOB(fd,50)=5;
+ WFIFOSET(fd, packet_len_table[0x78]);
+ return;
+}
+
/*==========================================
*
*------------------------------------------
@@ -1720,6 +1733,9 @@ int clif_scriptmenu(struct map_session_data *sd, int npcid, char *mes) {
nullpo_retr(0, sd);
+ if(map_id2bl(npcid)->m < 0)
+ send_fake_npc(sd, npcid);
+
fd=sd->fd;
WFIFOW(fd,0)=0xb7;
WFIFOW(fd,2)=slen;
@@ -1739,6 +1755,9 @@ int clif_scriptinput(struct map_session_data *sd, int npcid) {
nullpo_retr(0, sd);
+ if(map_id2bl(npcid)->m < 0)
+ send_fake_npc(sd, npcid);
+
fd=sd->fd;
WFIFOHEAD(fd, packet_len_table[0x142]);
WFIFOW(fd,0)=0x142;
@@ -1757,6 +1776,9 @@ int clif_scriptinputstr(struct map_session_data *sd, int npcid) {
nullpo_retr(0, sd);
+ if(map_id2bl(npcid)->m < 0)
+ send_fake_npc(sd, npcid);
+
fd=sd->fd;
WFIFOHEAD(fd, packet_len_table[0x1d4]);
WFIFOW(fd,0)=0x1d4;
diff --git a/src/map/npc.h b/src/map/npc.h
index a2c6b5ca4..760a61aae 100644
--- a/src/map/npc.h
+++ b/src/map/npc.h
@@ -38,7 +38,7 @@ int npc_parse_mob(char *w1,char *w2,char *w3,char *w4);
int npc_parse_mob2 (struct spawn_data*, int index); // [Wizputer]
int npc_parse_warp(char *w1,char *w2,char *w3,char *w4);
int npc_globalmessage(const char *name,char *mes);
-int npc_event_sub(struct map_session_data *sd, struct event_data *ev, const unsigned char *eventname); //[Lance]
+int npc_event_sub(struct map_session_data *, struct event_data *, const unsigned char *); //[Lance]
int npc_enable(const char *name,int flag);
int npc_changename(const char *name, const char *newname, short look); // [Lance]