Ver Fonte

Follow up 7fcacb64c44f4305352d55dc12390aaaa8882997

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
Cydh Ramdh há 10 anos atrás
pai
commit
7864250955
4 ficheiros alterados com 29 adições e 31 exclusões
  1. 0 2
      src/map/buyingstore.c
  2. 28 0
      src/map/buyingstore.h
  3. 1 1
      src/map/vending.c
  4. 0 28
      src/map/vending.h

+ 0 - 2
src/map/buyingstore.c

@@ -14,7 +14,6 @@
 #include "log.h"  // log_pick_pc, log_zeny
 #include "pc.h"  // struct map_session_data
 #include "chrif.h"
-#include "vending.h" // struct s_autotrade_entry, struct s_autotrader
 
 #include <stdlib.h> // atoi
 
@@ -649,7 +648,6 @@ void buyingstore_reopen( struct map_session_data* sd ){
 
 /**
 * Initializing autotraders from table
-* TODO: Make this support for multi map-server
 */
 void do_init_buyingstore_autotrade( void ) {
 	if(battle_config.feature_autotrade) {

+ 28 - 0
src/map/buyingstore.h

@@ -22,6 +22,34 @@ struct s_buyingstore
 	unsigned char slots;
 };
 
+/// Autotrade entry
+struct s_autotrade_entry {
+	uint16 cartinventory_id; ///< Item entry id/cartinventory_id in cart_inventory table (for vending)
+	uint16 amount; ///< Amount
+	uint32 price; ///< Price
+	uint16 index; ///< Item index in cart
+	uint32 item_id; ///< Item ID (for buyingstore)
+};
+
+/// Struct of autotrader
+struct s_autotrader {
+	uint16 id; ///< vendor/buyer id
+	uint32 account_id; ///< Account ID
+	uint32 char_id; ///< Char ID
+	int m; ///< Map location
+	uint16 x, ///< X location
+		y; ///< Y location
+	unsigned char sex, ///< Autotrader's sex
+		dir, ///< Body direction
+		head_dir, ///< Head direction
+		sit; ///< Is sitting?
+	char title[MESSAGE_SIZE]; ///< Store name
+	uint32 limit; ///< Maximum zeny to be spent (for buyingstore)
+	uint16 count; ///< Number of item in store
+	struct s_autotrade_entry **entries; ///< Store details
+	struct map_session_data *sd;
+};
+
 int8 buyingstore_setup(struct map_session_data* sd, unsigned char slots);
 int8 buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned char result, const char* storename, const uint8* itemlist, unsigned int count, struct s_autotrader *at);
 void buyingstore_close(struct map_session_data* sd);

+ 1 - 1
src/map/vending.c

@@ -12,6 +12,7 @@
 #include "chrif.h"
 #include "vending.h"
 #include "pc.h"
+#include "buyingstore.h" // struct s_autotrade_entry, struct s_autotrader
 
 #include <stdlib.h> // atoi
 
@@ -535,7 +536,6 @@ void vending_reopen( struct map_session_data* sd )
 
 /**
 * Initializing autotraders from table
-* TODO: Make this support for multi map-server
 */
 void do_init_vending_autotrade(void)
 {

+ 0 - 28
src/map/vending.h

@@ -15,34 +15,6 @@ struct s_vending {
 	unsigned int value; ///at wich price
 };
 
-/// Struct for vending entry of autotrader
-struct s_autotrade_entry {
-	uint16 cartinventory_id; ///< Item entry id/cartinventory_id in cart_inventory table (for vending)
-	uint16 amount; ///< Amount
-	uint32 price; ///< Price
-	uint16 index; ///< Item index in cart
-	uint32 item_id; ///< Item ID (for buyingstore)
-};
-
-/// Struct of autotrader
-struct s_autotrader {
-	uint16 id; ///< vendor/buyer id
-	uint32 account_id; ///< Account ID
-	uint32 char_id; ///< Char ID
-	int m; ///< Map location
-	uint16 x, ///< X location
-		y; ///< Y location
-	unsigned char sex, ///< Autotrader's sex
-		dir, ///< Body direction
-		head_dir, ///< Head direction
-		sit; ///< Is sitting?
-	char title[MESSAGE_SIZE]; ///< Store name
-	uint32 limit; ///< Maximum zeny to be spent (for buyingstore)
-	uint16 count; ///< Number of item in store
-	struct s_autotrade_entry **entries; ///< Store details
-	struct map_session_data *sd;
-};
-
 DBMap * vending_getdb();
 void do_final_vending(void);
 void do_init_vending(void);