summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-02-11 02:00:58 +0100
committerGitHub <noreply@github.com>2019-02-11 02:00:58 +0100
commit2d8a44b753832610d23678629127369f5db576a3 (patch)
tree258e78c458642cc017837f674b0d23255ac49bf4 /src/char
parent68126f7d762e001b1a34cfe5e0a340db9c7d9da8 (diff)
parentdbaa9ac111496fdfde9948d5cb15a0b052843b3f (diff)
downloadhercules-2d8a44b753832610d23678629127369f5db576a3.tar.gz
hercules-2d8a44b753832610d23678629127369f5db576a3.tar.bz2
hercules-2d8a44b753832610d23678629127369f5db576a3.tar.xz
hercules-2d8a44b753832610d23678629127369f5db576a3.zip
Merge pull request #2364 from 4144/shortfixes
Change different variables types short to int
Diffstat (limited to 'src/char')
-rw-r--r--src/char/char.c6
-rw-r--r--src/char/char.h2
-rw-r--r--src/char/int_guild.c4
-rw-r--r--src/char/int_guild.h2
-rw-r--r--src/char/int_pet.c2
-rw-r--r--src/char/int_pet.h2
-rw-r--r--src/char/int_rodex.c4
-rw-r--r--src/char/int_rodex.h2
-rw-r--r--src/char/inter.c4
-rw-r--r--src/char/mapif.c44
-rw-r--r--src/char/mapif.h4
11 files changed, 38 insertions, 38 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 49135aa79..34a3ea7a8 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -1098,7 +1098,7 @@ static int char_mmo_chars_fromsql(struct char_session_data *sd, uint8 *buf, int
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 0, SQLDT_INT, &p.char_id, sizeof p.char_id, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 1, SQLDT_UCHAR, &p.slot, sizeof p.slot, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 2, SQLDT_STRING, &p.name, sizeof p.name, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 3, SQLDT_INT16, &p.class, sizeof p.class, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 3, SQLDT_INT, &p.class, sizeof p.class, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 4, SQLDT_INT, &p.base_level, sizeof p.base_level, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 5, SQLDT_INT, &p.job_level, sizeof p.job_level, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 6, SQLDT_UINT64, &p.base_exp, sizeof p.base_exp, NULL, NULL)
@@ -1221,7 +1221,7 @@ static int char_mmo_char_fromsql(int char_id, struct mmo_charstatus *p, bool loa
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 1, SQLDT_INT, &p->account_id, sizeof p->account_id, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 2, SQLDT_UCHAR, &p->slot, sizeof p->slot, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 3, SQLDT_STRING, &p->name, sizeof p->name, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 4, SQLDT_INT16, &p->class, sizeof p->class, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 4, SQLDT_INT, &p->class, sizeof p->class, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 5, SQLDT_INT, &p->base_level, sizeof p->base_level, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 6, SQLDT_INT, &p->job_level, sizeof p->job_level, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 7, SQLDT_UINT64, &p->base_exp, sizeof p->base_exp, NULL, NULL)
@@ -1705,7 +1705,7 @@ static int char_check_char_name(const char *name, const char *esc_name)
* -5: 'Symbols in Character Names are forbidden'
* char_id: Success
**/
-static int char_make_new_char_sql(struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, int16 starting_class, uint8 sex)
+static int char_make_new_char_sql(struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, int starting_class, uint8 sex)
{
char name[NAME_LENGTH];
char esc_name[NAME_LENGTH*2+1];
diff --git a/src/char/char.h b/src/char/char.h
index 632695ca4..5de3e2a80 100644
--- a/src/char/char.h
+++ b/src/char/char.h
@@ -149,7 +149,7 @@ struct char_interface {
int (*rename_char_sql) (struct char_session_data *sd, int char_id);
bool (*name_exists) (const char *name, const char *esc_name);
int (*check_char_name) (const char *name, const char *esc_name);
- int (*make_new_char_sql) (struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, short starting_job, uint8 sex);
+ int (*make_new_char_sql) (struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, int starting_job, uint8 sex);
int (*divorce_char_sql) (int partner_id1, int partner_id2);
int (*count_users) (void);
int (*mmo_char_tobuf) (uint8* buffer, struct mmo_charstatus* p);
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index 56e1c1ba3..9c0be1629 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -1060,7 +1060,7 @@ static bool inter_guild_leave(int guild_id, int account_id, int char_id, int fla
}
// Change member info
-static bool inter_guild_update_member_info_short(int guild_id, int account_id, int char_id, int online, int lv, int16 class)
+static bool inter_guild_update_member_info_short(int guild_id, int account_id, int char_id, int online, int lv, int class)
{
// Could speed up by manipulating only guild_member
struct guild *g;
@@ -1602,7 +1602,7 @@ static int inter_guild_parse_frommap(int fd)
case 0x3032: mapif->parse_GuildAddMember(fd, RFIFOL(fd,4), RFIFOP(fd,8)); break;
case 0x3033: mapif->parse_GuildMasterChange(fd, RFIFOL(fd,4), RFIFOP(fd,8), RFIFOW(fd,2)-8); break;
case 0x3034: mapif->parse_GuildLeave(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOB(fd,14), RFIFOP(fd,15)); break;
- case 0x3035: mapif->parse_GuildChangeMemberInfoShort(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOW(fd,15),RFIFOW(fd,17)); break;
+ case 0x3035: mapif->parse_GuildChangeMemberInfoShort(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOL(fd,15),RFIFOL(fd,19)); break;
case 0x3036: mapif->parse_BreakGuild(fd,RFIFOL(fd,2)); break;
case 0x3037: mapif->parse_GuildMessage(fd, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12), RFIFOW(fd,2)-12); break;
case 0x3039: mapif->parse_GuildBasicInfoChange(fd, RFIFOL(fd,4), RFIFOW(fd,8), RFIFOP(fd,10), RFIFOW(fd,2)-10); break;
diff --git a/src/char/int_guild.h b/src/char/int_guild.h
index 33873edcd..4ed0f526e 100644
--- a/src/char/int_guild.h
+++ b/src/char/int_guild.h
@@ -72,7 +72,7 @@ struct inter_guild_interface {
struct guild *(*create) (const char *name, const struct guild_member *master);
bool (*add_member) (int guild_id, const struct guild_member *member, int map_fd);
bool (*leave) (int guild_id, int account_id, int char_id, int flag, const char *mes, int map_fd);
- bool (*update_member_info_short) (int guild_id, int account_id, int char_id, int online, int lv, int16 class);
+ bool (*update_member_info_short) (int guild_id, int account_id, int char_id, int online, int lv, int class);
bool (*update_member_info) (int guild_id, int account_id, int char_id, int type, const char *data, int len);
bool (*disband) (int guild_id);
bool (*update_basic_info) (int guild_id, int type, const void *data, int len);
diff --git a/src/char/int_pet.c b/src/char/int_pet.c
index 8f87becff..d31e7545c 100644
--- a/src/char/int_pet.c
+++ b/src/char/int_pet.c
@@ -160,7 +160,7 @@ 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, int pet_egg_id,
+static struct s_pet *inter_pet_create(int account_id, int char_id, int pet_class, int 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);
diff --git a/src/char/int_pet.h b/src/char/int_pet.h
index 104771735..b5852d441 100644
--- a/src/char/int_pet.h
+++ b/src/char/int_pet.h
@@ -37,7 +37,7 @@ 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, int pet_egg_id,
+ struct s_pet *(*create) (int account_id, int char_id, int pet_class, int 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 18c277574..5725c3777 100644
--- a/src/char/int_rodex.c
+++ b/src/char/int_rodex.c
@@ -268,7 +268,7 @@ static bool inter_rodex_hasnew(int char_id, int account_id)
}
/// Checks player name and retrieves some data
-static bool inter_rodex_checkname(const char *name, int *target_char_id, short *target_class, int *target_level)
+static bool inter_rodex_checkname(const char *name, int *target_char_id, int *target_class, int *target_level)
{
char esc_name[NAME_LENGTH * 2 + 1];
bool found = false;
@@ -286,7 +286,7 @@ static bool inter_rodex_checkname(const char *name, int *target_char_id, short *
if (SQL_SUCCESS == SQL->NextRow(inter->sql_handle)) {
char *data;
SQL->GetData(inter->sql_handle, 0, &data, NULL); *target_char_id = atoi(data);
- SQL->GetData(inter->sql_handle, 1, &data, NULL); *target_class = (short)atoi(data);
+ SQL->GetData(inter->sql_handle, 1, &data, NULL); *target_class = atoi(data);
SQL->GetData(inter->sql_handle, 2, &data, NULL); *target_level = atoi(data);
found = true;
}
diff --git a/src/char/int_rodex.h b/src/char/int_rodex.h
index 43e2d891c..7fae77d8d 100644
--- a/src/char/int_rodex.h
+++ b/src/char/int_rodex.h
@@ -34,7 +34,7 @@ struct inter_rodex_interface {
int (*parse_frommap) (int fd);
int (*fromsql) (int char_id, int account_id, int8 opentype, int64 mail_id, struct rodex_maillist *mails);
bool (*hasnew) (int char_id, int account_id);
- bool (*checkname) (const char *name, int *target_char_id, short *target_class, int *target_level);
+ bool (*checkname) (const char *name, int *target_char_id, int *target_class, int *target_level);
int64 (*savemessage) (struct rodex_message* msg);
bool (*updatemail) (int64 mail_id, int8 flag);
};
diff --git a/src/char/inter.c b/src/char/inter.c
index 418c9b0a1..1f1750e32 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -73,12 +73,12 @@ static int inter_recv_packet_length[] = {
-1,-1, 7,-1, -1,13,36, (2 + 4 + 4 + 4 + NAME_LENGTH), 0, 0, 0, 0, 0, 0, 0, 0, // 3000-
6,-1, 6,-1, 0, 0, 0, 0, 10,-1, 0, 0, 0, 0, 0, 0, // 3010- Account Storage, Achievements [Smokexyz]
-1,10,-1,14, 14,19, 6,-1, 14,14, 0, 0, 0, 0, 0, 0, // 3020- Party
- -1, 6,-1,-1, 55,19, 6,-1, 14,-1,-1,-1, 18,19,186,-1, // 3030-
+ -1, 6,-1,-1, 55,23, 6,-1, 14,-1,-1,-1, 18,19,186,-1, // 3030-
-1, 9, 0, 0, 10,10, 0, 0, 7, 6,10,10, 10,-1, 0, 0, // 3040- Clan System(3044-3045)
-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]
- 52,14,-1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3080-
+ 56,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 dc5735550..73b7fd46d 100644
--- a/src/char/mapif.c
+++ b/src/char/mapif.c
@@ -578,9 +578,9 @@ static int mapif_guild_memberinfoshort(struct guild *g, int idx)
WBUFL(buf, 10) = g->member[idx].char_id;
WBUFB(buf, 14) = (unsigned char)g->member[idx].online;
WBUFW(buf, 15) = g->member[idx].lv;
- WBUFW(buf, 17) = g->member[idx].class;
- WBUFL(buf, 19) = g->member[idx].last_login;
- mapif->sendall(buf, 23);
+ WBUFL(buf, 17) = g->member[idx].class;
+ WBUFL(buf, 21) = g->member[idx].last_login;
+ mapif->sendall(buf, 25);
return 0;
}
@@ -797,7 +797,7 @@ static int mapif_parse_GuildLeave(int fd, int guild_id, int account_id, int char
}
// Change member info
-static int mapif_parse_GuildChangeMemberInfoShort(int fd, int guild_id, int account_id, int char_id, int online, int lv, int16 class)
+static int mapif_parse_GuildChangeMemberInfoShort(int fd, int guild_id, int account_id, int char_id, int online, int lv, int class)
{
inter_guild->update_member_info_short(guild_id, account_id, char_id, online, lv, class);
return 0;
@@ -1427,14 +1427,14 @@ static int mapif_pet_created(int fd, int account_id, struct s_pet *p)
WFIFOW(fd, 0) = 0x3880;
WFIFOL(fd, 2) = account_id;
if (p != NULL){
- WFIFOW(fd, 6) = p->class_;
- WFIFOL(fd, 8) = p->pet_id;
+ WFIFOL(fd, 6) = p->class_;
+ WFIFOL(fd, 10) = p->pet_id;
ShowInfo("int_pet: created pet %d - %s\n", p->pet_id, p->name);
} else {
- WFIFOB(fd, 6) = 0;
- WFIFOL(fd, 8) = 0;
+ WFIFOL(fd, 6) = 0;
+ WFIFOL(fd, 10) = 0;
}
- WFIFOSET(fd, 12);
+ WFIFOSET(fd, 14);
return 0;
}
@@ -1521,15 +1521,15 @@ static int mapif_parse_CreatePet(int fd)
account_id = RFIFOL(fd, 2);
pet = inter_pet->create(account_id,
RFIFOL(fd, 6),
- RFIFOW(fd, 10),
- RFIFOW(fd, 12),
+ RFIFOL(fd, 10),
RFIFOL(fd, 14),
RFIFOL(fd, 18),
- RFIFOW(fd, 22),
- RFIFOW(fd, 24),
- RFIFOB(fd, 26),
- RFIFOB(fd, 27),
- RFIFOP(fd, 28));
+ RFIFOL(fd, 22),
+ RFIFOW(fd, 26),
+ RFIFOW(fd, 28),
+ RFIFOB(fd, 30),
+ RFIFOB(fd, 31),
+ RFIFOP(fd, 32));
if (pet != NULL)
mapif->pet_created(fd, account_id, pet);
@@ -1789,7 +1789,7 @@ static void mapif_parse_rodex_checkname(int fd)
int reqchar_id = RFIFOL(fd, 2);
char name[NAME_LENGTH];
int target_char_id, target_level;
- short target_class;
+ int target_class;
safestrncpy(name, RFIFOP(fd, 6), NAME_LENGTH);
@@ -1799,7 +1799,7 @@ static void mapif_parse_rodex_checkname(int fd)
mapif->rodex_checkname(fd, reqchar_id, 0, 0, 0, name);
}
-static void mapif_rodex_checkname(int fd, int reqchar_id, int target_char_id, short target_class, int target_level, char *name)
+static void mapif_rodex_checkname(int fd, int reqchar_id, int target_char_id, int target_class, int target_level, char *name)
{
nullpo_retv(name);
Assert_retv(reqchar_id > 0);
@@ -1809,10 +1809,10 @@ static void mapif_rodex_checkname(int fd, int reqchar_id, int target_char_id, sh
WFIFOW(fd, 0) = 0x3898;
WFIFOL(fd, 2) = reqchar_id;
WFIFOL(fd, 6) = target_char_id;
- WFIFOW(fd, 10) = target_class;
- WFIFOL(fd, 12) = target_level;
- safestrncpy(WFIFOP(fd, 16), name, NAME_LENGTH);
- WFIFOSET(fd, 16 + NAME_LENGTH);
+ WFIFOL(fd, 10) = target_class;
+ WFIFOL(fd, 14) = target_level;
+ safestrncpy(WFIFOP(fd, 18), name, NAME_LENGTH);
+ WFIFOSET(fd, 18 + NAME_LENGTH);
}
static int mapif_load_guild_storage(int fd, int account_id, int guild_id, char flag)
diff --git a/src/char/mapif.h b/src/char/mapif.h
index bfdefe4ea..f57748ac6 100644
--- a/src/char/mapif.h
+++ b/src/char/mapif.h
@@ -84,7 +84,7 @@ struct mapif_interface {
int (*parse_GuildInfo) (int fd, int guild_id);
int (*parse_GuildAddMember) (int fd, int guild_id, const struct guild_member *m);
int (*parse_GuildLeave) (int fd, int guild_id, int account_id, int char_id, int flag, const char *mes);
- int (*parse_GuildChangeMemberInfoShort) (int fd, int guild_id, int account_id, int char_id, int online, int lv, int16 class);
+ int (*parse_GuildChangeMemberInfoShort) (int fd, int guild_id, int account_id, int char_id, int online, int lv, int class);
int (*parse_BreakGuild) (int fd, int guild_id);
int (*parse_GuildMessage) (int fd, int guild_id, int account_id, const char *mes, int len);
int (*parse_GuildBasicInfoChange) (int fd, int guild_id, int type, const void *data, int len);
@@ -167,7 +167,7 @@ struct mapif_interface {
void (*parse_rodex_send) (int fd);
void (*rodex_send) (int fd, int sender_id, int receiver_id, int receiver_accountid, bool result);
void (*parse_rodex_checkname) (int fd);
- void (*rodex_checkname) (int fd, int reqchar_id, int target_char_id, short target_class, int target_level, char *name);
+ void (*rodex_checkname) (int fd, int reqchar_id, int target_char_id, int target_class, int target_level, char *name);
int (*load_guild_storage) (int fd, int account_id, int guild_id, char flag);
int (*save_guild_storage_ack) (int fd, int account_id, int guild_id, int fail);
int (*parse_LoadGuildStorage) (int fd);