浏览代码

Fixed variable type mismatch for autotraders
* `struct s_autotrader::id` was `uint16`, should be `uint32`.
* `struct s_autotrade_entry::cartinventory_id` was `uint16`, should be `uint32`.

Signed-off-by: Cydh Ramdh <cydh@pservero.com>

Cydh Ramdh 9 年之前
父节点
当前提交
9cee995f3f
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 2 2
      src/map/buyingstore.h
  2. 1 1
      src/map/vending.c

+ 2 - 2
src/map/buyingstore.h

@@ -24,7 +24,7 @@ struct s_buyingstore
 
 /// Autotrade entry
 struct s_autotrade_entry {
-	uint16 cartinventory_id; ///< Item entry id/cartinventory_id in cart_inventory table (for vending)
+	uint32 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
@@ -33,7 +33,7 @@ struct s_autotrade_entry {
 
 /// Struct of autotrader
 struct s_autotrader {
-	uint16 id; ///< vendor/buyer id
+	uint32 id; ///< vendor/buyer id
 	uint32 account_id; ///< Account ID
 	uint32 char_id; ///< Char ID
 	int m; ///< Map location

+ 1 - 1
src/map/vending.c

@@ -566,7 +566,7 @@ void do_init_vending_autotrade(void)
 				Sql_GetData(mmysql_handle, 0, &data, NULL); at->id = atoi(data);
 				Sql_GetData(mmysql_handle, 1, &data, NULL); at->account_id = atoi(data);
 				Sql_GetData(mmysql_handle, 2, &data, NULL); at->char_id = atoi(data);
-				Sql_GetData(mmysql_handle, 3, &data, NULL); at->sex = (data[0] == 'F') ? 0 : 1;
+				Sql_GetData(mmysql_handle, 3, &data, NULL); at->sex = (data[0] == 'F') ? SEX_FEMALE : SEX_MALE;
 				Sql_GetData(mmysql_handle, 4, &data, &len); safestrncpy(at->title, data, min(len + 1, MESSAGE_SIZE));
 				Sql_GetData(mmysql_handle, 5, &data, NULL); at->dir = atoi(data);
 				Sql_GetData(mmysql_handle, 6, &data, NULL); at->head_dir = atoi(data);