summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-07-16 06:08:24 +0300
committerAndrei Karas <akaras@inbox.ru>2018-07-17 01:00:22 +0300
commit0c2cf7579324ade56287b9a15f1fc7c0a8dffffd (patch)
tree2fb002974ed6652c2217ab6e5fb2d60734e364a3 /src
parent58a8c9e6cf38e3fdb2557ec9d00169e96411f915 (diff)
downloadhercules-0c2cf7579324ade56287b9a15f1fc7c0a8dffffd.tar.gz
hercules-0c2cf7579324ade56287b9a15f1fc7c0a8dffffd.tar.bz2
hercules-0c2cf7579324ade56287b9a15f1fc7c0a8dffffd.tar.xz
hercules-0c2cf7579324ade56287b9a15f1fc7c0a8dffffd.zip
Replace item id shorts to int in char server.
Diffstat (limited to 'src')
-rw-r--r--src/char/char.c34
-rw-r--r--src/char/int_pet.c4
-rw-r--r--src/char/int_pet.h4
-rw-r--r--src/char/int_rodex.c4
-rw-r--r--src/char/int_storage.c6
5 files changed, 26 insertions, 26 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 914017092..99198fa50 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -767,7 +767,7 @@ static int char_getitemdata_from_sql(struct item *items, int max, int guid, enum
}
if (SQL_ERROR == SQL->StmtBindColumn(stmt, 0, SQLDT_INT, &item.id, sizeof item.id, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 1, SQLDT_SHORT, &item.nameid, sizeof item.nameid, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 1, SQLDT_INT, &item.nameid, sizeof item.nameid, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 2, SQLDT_SHORT, &item.amount, sizeof item.amount, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 3, SQLDT_UINT, &item.equip, sizeof item.equip, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 4, SQLDT_CHAR, &item.identify, sizeof item.identify, NULL, NULL)
@@ -781,7 +781,7 @@ static int char_getitemdata_from_sql(struct item *items, int max, int guid, enum
}
for (i = 0; i < MAX_SLOTS; i++) {
- if (SQL_ERROR == SQL->StmtBindColumn(stmt, 10 + i, SQLDT_SHORT, &item.card[i], sizeof item.card[i], NULL, NULL))
+ if (SQL_ERROR == SQL->StmtBindColumn(stmt, 10 + i, SQLDT_INT, &item.card[i], sizeof item.card[i], NULL, NULL))
SqlStmt_ShowDebug(stmt);
}
@@ -872,7 +872,7 @@ static int char_memitemdata_to_sql(const struct item *p_items, int guid, enum in
&& p_items[j].nameid != 0
&& cp_it->nameid == p_items[j].nameid
&& cp_it->unique_id == p_items[j].unique_id
- && memcmp(p_items[j].card, cp_it->card, sizeof(short) * MAX_SLOTS) == 0
+ && memcmp(p_items[j].card, cp_it->card, sizeof(int) * MAX_SLOTS) == 0
&& memcmp(p_items[j].option, cp_it->option, 5 * MAX_ITEM_OPTIONS) == 0);
if (j < item_count) { // Item found.
@@ -1099,16 +1099,16 @@ static int char_mmo_chars_fromsql(struct char_session_data *sd, uint8 *buf)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 24, SQLDT_SHORT, &p.hair, sizeof p.hair, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 25, SQLDT_SHORT, &p.hair_color, sizeof p.hair_color, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 26, SQLDT_SHORT, &p.clothes_color, sizeof p.clothes_color, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 27, SQLDT_SHORT, &p.body, sizeof p.body, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 28, SQLDT_SHORT, &p.look.weapon, sizeof p.look.weapon, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 29, SQLDT_SHORT, &p.look.shield, sizeof p.look.shield, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 30, SQLDT_SHORT, &p.look.head_top, sizeof p.look.head_top, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 31, SQLDT_SHORT, &p.look.head_mid, sizeof p.look.head_mid, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 32, SQLDT_SHORT, &p.look.head_bottom, sizeof p.look.head_bottom, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 27, SQLDT_INT, &p.body, sizeof p.body, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 28, SQLDT_INT, &p.look.weapon, sizeof p.look.weapon, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 29, SQLDT_INT, &p.look.shield, sizeof p.look.shield, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 30, SQLDT_INT, &p.look.head_top, sizeof p.look.head_top, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 31, SQLDT_INT, &p.look.head_mid, sizeof p.look.head_mid, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 32, SQLDT_INT, &p.look.head_bottom, sizeof p.look.head_bottom, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 33, SQLDT_STRING, &last_map, sizeof last_map, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 34, SQLDT_USHORT, &p.rename, sizeof p.rename, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 35, SQLDT_TIME, &p.delete_date, sizeof p.delete_date, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 36, SQLDT_SHORT, &p.look.robe, sizeof p.look.robe, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 36, SQLDT_INT, &p.look.robe, sizeof p.look.robe, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 37, SQLDT_USHORT, &p.slotchange, sizeof p.slotchange, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 38, SQLDT_TIME, &unban_time, sizeof unban_time, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 39, SQLDT_ENUM, &sex, sizeof sex, NULL, NULL)
@@ -1213,12 +1213,12 @@ static int char_mmo_char_fromsql(int char_id, struct mmo_charstatus *p, bool loa
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 30, SQLDT_SHORT, &p->hair, sizeof p->hair, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 31, SQLDT_SHORT, &p->hair_color, sizeof p->hair_color, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 32, SQLDT_SHORT, &p->clothes_color, sizeof p->clothes_color, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 33, SQLDT_SHORT, &p->body, sizeof p->body, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 34, SQLDT_SHORT, &p->look.weapon, sizeof p->look.weapon, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 35, SQLDT_SHORT, &p->look.shield, sizeof p->look.shield, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 36, SQLDT_SHORT, &p->look.head_top, sizeof p->look.head_top, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 37, SQLDT_SHORT, &p->look.head_mid, sizeof p->look.head_mid, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 38, SQLDT_SHORT, &p->look.head_bottom, sizeof p->look.head_bottom, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 33, SQLDT_INT, &p->body, sizeof p->body, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 34, SQLDT_INT, &p->look.weapon, sizeof p->look.weapon, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 35, SQLDT_INT, &p->look.shield, sizeof p->look.shield, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 36, SQLDT_INT, &p->look.head_top, sizeof p->look.head_top, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 37, SQLDT_INT, &p->look.head_mid, sizeof p->look.head_mid, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 38, SQLDT_INT, &p->look.head_bottom, sizeof p->look.head_bottom, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 39, SQLDT_STRING, &last_map, sizeof last_map, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 40, SQLDT_INT16, &p->last_point.x, sizeof p->last_point.x, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 41, SQLDT_INT16, &p->last_point.y, sizeof p->last_point.y, NULL, NULL)
@@ -1232,7 +1232,7 @@ static int char_mmo_char_fromsql(int char_id, struct mmo_charstatus *p, bool loa
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 49, SQLDT_INT, &p->fame, sizeof p->fame, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 50, SQLDT_USHORT, &p->rename, sizeof p->rename, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 51, SQLDT_TIME, &p->delete_date, sizeof p->delete_date, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 52, SQLDT_SHORT, &p->look.robe, sizeof p->look.robe, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 52, SQLDT_INT, &p->look.robe, sizeof p->look.robe, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 53, SQLDT_USHORT, &p->slotchange, sizeof p->slotchange, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 54, SQLDT_UINT, &opt, sizeof opt, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 55, SQLDT_UCHAR, &p->font, sizeof p->font, NULL, NULL)
diff --git a/src/char/int_pet.c b/src/char/int_pet.c
index e824d7b58..8f87becff 100644
--- a/src/char/int_pet.c
+++ b/src/char/int_pet.c
@@ -160,8 +160,8 @@ static int inter_pet_delete(int pet_id)
return 0;
}
//------------------------------------------------------
-static struct s_pet *inter_pet_create(int account_id, int char_id, short pet_class, short pet_lv, short pet_egg_id,
- short pet_equip, short intimate, short hungry, char rename_flag, char incubate, const char *pet_name)
+static struct s_pet *inter_pet_create(int account_id, int char_id, short pet_class, short pet_lv, int pet_egg_id,
+ int pet_equip, short intimate, short hungry, char rename_flag, char incubate, const char *pet_name)
{
nullpo_ret(pet_name);
memset(inter_pet->pt, 0, sizeof(struct s_pet));
diff --git a/src/char/int_pet.h b/src/char/int_pet.h
index 9e3a2ac59..104771735 100644
--- a/src/char/int_pet.h
+++ b/src/char/int_pet.h
@@ -37,8 +37,8 @@ struct inter_pet_interface {
int (*delete_) (int pet_id);
int (*parse_frommap) (int fd);
- struct s_pet *(*create) (int account_id, int char_id, short pet_class, short pet_lv, short pet_egg_id,
- short pet_equip, short intimate, short hungry, char rename_flag, char incubate, const char *pet_name);
+ struct s_pet *(*create) (int account_id, int char_id, short pet_class, short pet_lv, int pet_egg_id,
+ int pet_equip, short intimate, short hungry, char rename_flag, char incubate, const char *pet_name);
struct s_pet *(*load) (int account_id, int char_id, int pet_id);
};
diff --git a/src/char/int_rodex.c b/src/char/int_rodex.c
index e70a6bbf5..18c277574 100644
--- a/src/char/int_rodex.c
+++ b/src/char/int_rodex.c
@@ -164,7 +164,7 @@ static int inter_rodex_fromsql(int char_id, int account_id, int8 opentype, int64
if (msg.type & MAIL_TYPE_ITEM) {
if (SQL_ERROR == SQL->StmtExecute(stmt_items)
- || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 0, SQLDT_SHORT, &it.nameid, sizeof it.nameid, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 0, SQLDT_INT, &it.nameid, sizeof it.nameid, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt_items, 1, SQLDT_SHORT, &it.amount, sizeof it.amount, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt_items, 2, SQLDT_UINT, &it.equip, sizeof it.equip, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt_items, 3, SQLDT_CHAR, &it.identify, sizeof it.identify, NULL, NULL)
@@ -177,7 +177,7 @@ static int inter_rodex_fromsql(int char_id, int account_id, int8 opentype, int64
SqlStmt_ShowDebug(stmt_items);
}
for (i = 0; i < MAX_SLOTS; i++) {
- if (SQL_ERROR == SQL->StmtBindColumn(stmt_items, 9 + i, SQLDT_SHORT, &it.card[i], sizeof it.card[i], NULL, NULL))
+ if (SQL_ERROR == SQL->StmtBindColumn(stmt_items, 9 + i, SQLDT_INT, &it.card[i], sizeof it.card[i], NULL, NULL))
SqlStmt_ShowDebug(stmt_items);
}
for (i = 0; i < MAX_ITEM_OPTIONS; i++) {
diff --git a/src/char/int_storage.c b/src/char/int_storage.c
index da4522971..130df5515 100644
--- a/src/char/int_storage.c
+++ b/src/char/int_storage.c
@@ -71,7 +71,7 @@ static int inter_storage_tosql(int account_id, const struct storage_data *p)
&& (p_it = &VECTOR_INDEX(p->item, j)) != NULL
&& cp_it->nameid == p_it->nameid
&& cp_it->unique_id == p_it->unique_id
- && memcmp(p_it->card, cp_it->card, sizeof(short) * MAX_SLOTS) == 0
+ && memcmp(p_it->card, cp_it->card, sizeof(int) * MAX_SLOTS) == 0
&& memcmp(p_it->option, cp_it->option, 5 * MAX_ITEM_OPTIONS) == 0);
if (j < VECTOR_LENGTH(p->item)) {
@@ -373,7 +373,7 @@ static bool inter_storage_retrieve_bound_items(int char_id, int account_id, int
memset(&item, 0, sizeof(item));
SQL->StmtBindColumn(stmt, 0, SQLDT_INT, &item.id, sizeof item.id, NULL, NULL);
- SQL->StmtBindColumn(stmt, 1, SQLDT_SHORT, &item.nameid, sizeof item.nameid, NULL, NULL);
+ SQL->StmtBindColumn(stmt, 1, SQLDT_INT, &item.nameid, sizeof item.nameid, NULL, NULL);
SQL->StmtBindColumn(stmt, 2, SQLDT_SHORT, &item.amount, sizeof item.amount, NULL, NULL);
SQL->StmtBindColumn(stmt, 3, SQLDT_UINT, &item.equip, sizeof item.equip, NULL, NULL);
SQL->StmtBindColumn(stmt, 4, SQLDT_CHAR, &item.identify, sizeof item.identify, NULL, NULL);
@@ -384,7 +384,7 @@ static bool inter_storage_retrieve_bound_items(int char_id, int account_id, int
SQL->StmtBindColumn(stmt, 9, SQLDT_UINT64, &item.unique_id, sizeof item.unique_id, NULL, NULL);
/* Card Slots */
for (j = 0; j < MAX_SLOTS; ++j)
- SQL->StmtBindColumn(stmt, 10 + j, SQLDT_SHORT, &item.card[j], sizeof item.card[j], NULL, NULL);
+ SQL->StmtBindColumn(stmt, 10 + j, SQLDT_INT, &item.card[j], sizeof item.card[j], NULL, NULL);
/* Item Options */
for (j = 0; j < MAX_ITEM_OPTIONS; ++j) {
SQL->StmtBindColumn(stmt, 10 + MAX_SLOTS + j * 2, SQLDT_INT16, &item.option[j].index, sizeof item.option[j].index, NULL, NULL);