summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
Diffstat (limited to 'src/char')
-rw-r--r--src/char/HPMchar.c2
-rw-r--r--src/char/HPMchar.h2
-rw-r--r--src/char/char.c38
-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
-rw-r--r--src/char/inter.c2
-rw-r--r--src/char/mapif.c13
9 files changed, 41 insertions, 34 deletions
diff --git a/src/char/HPMchar.c b/src/char/HPMchar.c
index 43a94604d..9f075d909 100644
--- a/src/char/HPMchar.c
+++ b/src/char/HPMchar.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2014-2015 Hercules Dev Team
+ * Copyright (C) 2014-2018 Hercules Dev Team
*
* Hercules is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/char/HPMchar.h b/src/char/HPMchar.h
index 2bf2820f8..0de3b88b8 100644
--- a/src/char/HPMchar.h
+++ b/src/char/HPMchar.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2014-2015 Hercules Dev Team
+ * Copyright (C) 2014-2018 Hercules Dev Team
*
* Hercules is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/char/char.c b/src/char/char.c
index 486cc7c03..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)
@@ -4419,9 +4419,7 @@ static void char_send_map_info(int fd, int i, uint32 subnet_map_ip, struct mmo_c
mapindex->getmapname_ext(mapindex_id2name(cd->last_point.map), WFIFOP(fd, 6));
WFIFOL(fd, 22) = htonl((subnet_map_ip) ? subnet_map_ip : chr->server[i].ip);
WFIFOW(fd, 26) = sockt->ntows(htons(chr->server[i].port)); // [!] LE byte order here [!]
-#if PACKETVER < 20170329
- memset(WFIFOP(fd, 28), 0, 128);
-#else
+#if PACKETVER >= 20170329
if (dnsHost != NULL) {
safestrncpy(WFIFOP(fd, 28), dnsHost, 128);
} else {
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);
diff --git a/src/char/inter.c b/src/char/inter.c
index 718dfd60d..7269009a7 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -77,7 +77,7 @@ static int inter_recv_packet_length[] = {
-1,-1,10,10, 0,-1,12, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3050- Auction System [Zephyrus], Item Bound [Mhalicot]
6,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3060- Quest system [Kevin] [Inkfish]
-1,10, 6,-1, 0, 0, 0, 0, 0, 0, 0, 0, -1,10, 6,-1, // 3070- Mercenary packets [Zephyrus], Elemental packets [pakpil]
- 48,14,-1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3080-
+ 52,14,-1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3080-
-1,10,-1, 6, 0, 20,10,11, -1,6 + NAME_LENGTH, 0, 0, 0, 0, 0, 0, // 3090- Homunculus packets [albator], RoDEX packets
};
diff --git a/src/char/mapif.c b/src/char/mapif.c
index 6acf803e2..30f8c1178 100644
--- a/src/char/mapif.c
+++ b/src/char/mapif.c
@@ -1518,8 +1518,17 @@ static int mapif_parse_CreatePet(int fd)
RFIFOHEAD(fd);
account_id = RFIFOL(fd, 2);
- pet = inter_pet->create(account_id, RFIFOL(fd, 6), RFIFOW(fd, 10), RFIFOW(fd, 12), RFIFOW(fd, 14),
- RFIFOW(fd, 16), RFIFOW(fd, 18), RFIFOW(fd, 20), RFIFOB(fd, 22), RFIFOB(fd, 23), RFIFOP(fd, 24));
+ pet = inter_pet->create(account_id,
+ RFIFOL(fd, 6),
+ RFIFOW(fd, 10),
+ RFIFOW(fd, 12),
+ RFIFOL(fd, 14),
+ RFIFOL(fd, 18),
+ RFIFOW(fd, 22),
+ RFIFOW(fd, 24),
+ RFIFOB(fd, 26),
+ RFIFOB(fd, 27),
+ RFIFOP(fd, 28));
if (pet != NULL)
mapif->pet_created(fd, account_id, pet);