浏览代码

* Fixed bug http://rathena.org/board/tracker/issue-8330-secure-npctimeout-bug-for-those-npc-who-have-no-dialog-window/
Merged Hercules adc2e6e

Lilith- 11 年之前
父节点
当前提交
54dfc67925
共有 3 个文件被更改,包括 19 次插入1 次删除
  1. 17 1
      src/map/clif.c
  2. 1 0
      src/map/clif.h
  3. 1 0
      src/map/pc.c

+ 17 - 1
src/map/clif.c

@@ -1919,6 +1919,22 @@ void clif_scriptclose(struct map_session_data *sd, int npcid)
 	WFIFOSET(fd,packet_len(0xb6));
 }
 
+/// [Ind/Hercules]
+/// Close script when player is idle
+/// 08d6 <npc id>.L
+void clif_scriptclear(struct map_session_data *sd, int npcid)
+{
+	int fd;
+
+	nullpo_retv(sd);
+
+	fd=sd->fd;
+	WFIFOHEAD(fd, packet_len(0x8d6));
+	WFIFOW(fd,0)=0x8d6;
+	WFIFOL(fd,2)=npcid;
+	WFIFOSET(fd,packet_len(0x8d6));
+ }
+ 
 /*==========================================
  *
  *------------------------------------------*/
@@ -17541,7 +17557,7 @@ void packetdb_readdb(void)
 		0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 	//#0x08C0
 		0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 10,
-		9,  7, 10,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+		9,  7, 10,  0,  0,  0,  6,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 		0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 		0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 	//#0x0900

+ 1 - 0
src/map/clif.h

@@ -392,6 +392,7 @@ void clif_selllist(struct map_session_data *sd);	//self
 void clif_scriptmes(struct map_session_data *sd, int npcid, const char *mes);	//self
 void clif_scriptnext(struct map_session_data *sd,int npcid);	//self
 void clif_scriptclose(struct map_session_data *sd, int npcid);	//self
+void clif_scriptclear(struct map_session_data *sd, int npcid);	//self
 void clif_scriptmenu(struct map_session_data* sd, int npcid, const char* mes);	//self
 void clif_scriptinput(struct map_session_data *sd, int npcid);	//self
 void clif_scriptinputstr(struct map_session_data *sd, int npcid);	// self

+ 1 - 0
src/map/pc.c

@@ -6750,6 +6750,7 @@ void pc_close_npc(struct map_session_data *sd,int flag)
 		sd->npc_idle_timer = INVALID_TIMER;
 #endif
 		clif_scriptclose(sd,sd->npc_id);
+		clif_scriptclear(sd,sd->npc_id); // [Ind/Hercules]
 		if(sd->st && sd->st->state == END ) {// free attached scripts that are waiting
 			script_free_state(sd->st);
 			sd->st = NULL;