浏览代码

Fixes #809
* Reverted 42b7ba9 and cef2f9e NPC shop ID checks.

aleos89 9 年之前
父节点
当前提交
0212d44bb4
共有 2 个文件被更改,包括 4 次插入7 次删除
  1. 2 4
      src/map/clif.c
  2. 2 3
      src/map/script.c

+ 2 - 4
src/map/clif.c

@@ -1913,8 +1913,6 @@ void clif_buylist(struct map_session_data *sd, struct npc_data *nd)
 
 	WFIFOW(fd,2) = 4 + c*11;
 	WFIFOSET(fd,WFIFOW(fd,2));
-
-	sd->npc_shopid = 0; // Clear shop data here in case Cancel is clicked.
 }
 
 
@@ -1953,8 +1951,6 @@ void clif_selllist(struct map_session_data *sd)
 	}
 	WFIFOW(fd,2)=c*10+4;
 	WFIFOSET(fd,WFIFOW(fd,2));
-
-	sd->npc_shopid = 0; // Clear shop data here in case Cancel is clicked.
 }
 
 
@@ -11300,6 +11296,7 @@ void clif_parse_NpcBuyListSend(int fd, struct map_session_data* sd)
 	else
 		result = npc_buylist(sd, n, (struct s_npc_buy_list*)RFIFOP(fd,info->pos[1]));
 
+	sd->npc_shopid = 0; //Clear shop data.
 	clif_npc_buy_result(sd, result);
 }
 
@@ -11336,6 +11333,7 @@ void clif_parse_NpcSellListSend(int fd,struct map_session_data *sd)
 	else
 		fail = npc_selllist(sd,n,item_list);
 
+	sd->npc_shopid = 0; //Clear shop data.
 	clif_npc_sell_result(sd, fail);
 }
 

+ 2 - 3
src/map/script.c

@@ -5122,8 +5122,7 @@ BUILDIN_FUNC(close)
 		st->mes_active = 0;
 	}
 
-	if (!sd->npc_shopid) // Don't close if a shop was opened.
-		clif_scriptclose(sd, st->oid);
+	clif_scriptclose(sd, st->oid);
 	return SCRIPT_CMD_SUCCESS;
 }
 
@@ -9377,7 +9376,7 @@ BUILDIN_FUNC(end)
 	if( st->mes_active )
 		st->mes_active = 0;
 
-	if (sd && !sd->npc_shopid) // Don't close if a shop was opened.
+	if (sd)
 		clif_scriptclose(sd, st->oid); // If a menu/select/prompt is active, close it.
 
 	return SCRIPT_CMD_SUCCESS;