Browse Source

Follow up 98cf6920, suggestion leftover

Cydh 3 years ago
parent
commit
cc16f46885
1 changed files with 3 additions and 4 deletions
  1. 3 4
      src/map/buyingstore.cpp

+ 3 - 4
src/map/buyingstore.cpp

@@ -330,13 +330,12 @@ void buyingstore_open(struct map_session_data* sd, uint32 account_id)
 static unsigned short buyinstore_tax_intotal(struct map_session_data* sd, const struct PACKET_CZ_REQ_TRADE_BUYING_STORE_sub* itemlist, int count) {
 	std::shared_ptr<s_tax> tax = tax_db.find(TAX_BUYING);
 
-	double total = 0;
-	int i;
-
 	if (tax == nullptr || tax->total.empty())
 		return 0;
 
-	for (i = 0; i < count; i++) {
+	double total = 0;
+
+	for (int i = 0; i < count; i++) {
 		const struct PACKET_CZ_REQ_TRADE_BUYING_STORE_sub* item = &itemlist[i];
 
 		if (item->amount <= 0)