From 3514f4405c2a822be2350fed27fe2d15cad7152c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 5 Feb 2019 07:18:05 +0300 Subject: Change type for class variables from short to int --- src/char/char.c | 6 +++--- src/char/char.h | 2 +- src/char/int_guild.c | 2 +- src/char/int_guild.h | 2 +- src/char/int_pet.c | 2 +- src/char/int_pet.h | 2 +- src/char/int_rodex.c | 4 ++-- src/char/int_rodex.h | 2 +- src/char/mapif.c | 6 +++--- src/char/mapif.h | 4 ++-- src/common/mmo.h | 16 ++++++++-------- src/map/atcommand.c | 2 +- src/map/battle.c | 4 ++-- src/map/clif.c | 6 +++--- src/map/clif.h | 2 +- src/map/guild.c | 2 +- src/map/guild.h | 2 +- src/map/homunculus.c | 2 +- src/map/homunculus.h | 2 +- src/map/intif.c | 4 ++-- src/map/intif.h | 4 ++-- src/map/map.h | 2 +- src/map/mob.h | 2 +- src/map/npc.c | 6 +++--- src/map/npc.h | 6 +++--- src/map/pc.c | 6 +++--- src/map/pc.h | 4 ++-- src/map/pet.c | 6 +++--- src/map/pet.h | 4 ++-- src/map/rodex.c | 2 +- src/map/rodex.h | 2 +- src/map/script.c | 2 +- 32 files changed, 60 insertions(+), 60 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..f9dcc1d64 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; 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/mapif.c b/src/char/mapif.c index dc5735550..0fb11fdbe 100644 --- a/src/char/mapif.c +++ b/src/char/mapif.c @@ -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; @@ -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); 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); diff --git a/src/common/mmo.h b/src/common/mmo.h index c29da580c..3a0f73520 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -590,7 +590,7 @@ struct s_pet { int account_id; int char_id; int pet_id; - short class_; + int class_; short level; int egg_id;//pet egg id int equip;//pet equip name_id @@ -606,8 +606,8 @@ struct s_homunculus { //[orn] char name[NAME_LENGTH]; int hom_id; int char_id; - short class_; - short prev_class; + int class_; + int prev_class; int hp,max_hp,sp,max_sp; unsigned int intimacy; short hunger; @@ -638,7 +638,7 @@ struct s_homunculus { //[orn] struct s_mercenary { int mercenary_id; int char_id; - short class_; + int class_; int hp, sp; unsigned int kill_count; unsigned int life_time; @@ -647,7 +647,7 @@ struct s_mercenary { struct s_elemental { int elemental_id; int char_id; - short class_; + int class_; uint32 mode; int hp, sp, max_hp, max_sp, matk, atk, atk2; short hit, flee, amotion, def, mdef; @@ -690,7 +690,7 @@ struct mmo_charstatus { int zeny; int bank_vault; - int16 class; + int class; int status_point, skill_point; int hp,max_hp,sp,max_sp; unsigned int option; @@ -805,7 +805,7 @@ struct party_member { int account_id; int char_id; char name[NAME_LENGTH]; - int16 class; + int class; unsigned short map; unsigned short lv; unsigned leader : 1, @@ -825,7 +825,7 @@ struct map_session_data; struct guild_member { int account_id, char_id; short hair,hair_color,gender; - int16 class; + int class; short lv; uint64 exp; int exp_payper; diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 0a1fd6da3..87be6ab1b 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -2718,7 +2718,7 @@ ACMD(makeegg) sd->catch_target_class = pet->db[pet_id].class_; intif->create_pet( sd->status.account_id, sd->status.char_id, - (short)pet->db[pet_id].class_, (short)mob->db(pet->db[pet_id].class_)->lv, + pet->db[pet_id].class_, mob->db(pet->db[pet_id].class_)->lv, pet->db[pet_id].EggID, 0, (short)pet->db[pet_id].intimate, 100, 0, 1, pet->db[pet_id].jname); } else { diff --git a/src/map/battle.c b/src/map/battle.c index f51240810..6fa46a7c7 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -1019,7 +1019,7 @@ static int64 battle_calc_cardfix(int attack_type, struct block_list *src, struct { struct map_session_data *sd, *tsd; int cardfix = 1000; - short t_class, s_class, s_race2, t_race2; + int t_class, s_class, s_race2, t_race2; struct status_data *sstatus, *tstatus; int i; @@ -5552,7 +5552,7 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl #endif if( flag.infdef ) { //Plants receive 1 damage when hit - short class_ = status->get_class(target); + int class_ = status->get_class(target); if( flag.hit || wd.damage > 0 ) wd.damage = wd.div_; // In some cases, right hand no need to have a weapon to increase damage if( flag.lh && (flag.hit || wd.damage2 > 0) ) diff --git a/src/map/clif.c b/src/map/clif.c index 024adffc5..86b130e88 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -14516,7 +14516,7 @@ static void clif_parse_pet_evolution(int fd, struct map_session_data *sd) intif->create_pet( sd->status.account_id, sd->status.char_id, - (short)pet->db[pet_id].class_, (short)mob->db(pet->db[pet_id].class_)->lv, + pet->db[pet_id].class_, mob->db(pet->db[pet_id].class_)->lv, pet->db[pet_id].EggID, 0, (short)pet->db[pet_id].intimate, 100, 0, 1, pet->db[pet_id].jname); clif->petEvolutionResult(fd, PET_EVOL_SUCCESS); @@ -21071,7 +21071,7 @@ static void clif_parse_rodex_checkname(int fd, struct map_session_data *sd) { const struct PACKET_CZ_CHECKNAME *rPacket = RFIFOP(fd, 0); int char_id = 0, base_level = 0; - short class = 0; + int class = 0; char name[NAME_LENGTH]; safestrncpy(name, rPacket->Name, NAME_LENGTH); @@ -21079,7 +21079,7 @@ static void clif_parse_rodex_checkname(int fd, struct map_session_data *sd) rodex->check_player(sd, name, &base_level, &char_id, &class); } -static void clif_rodex_checkname_result(struct map_session_data *sd, int char_id, short class_, int base_level, const char *name) +static void clif_rodex_checkname_result(struct map_session_data *sd, int char_id, int class_, int base_level, const char *name) { #if PACKETVER >= 20140521 struct PACKET_ZC_CHECKNAME *sPacket; diff --git a/src/map/clif.h b/src/map/clif.h index 36c360cbc..a7573b56e 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -1543,7 +1543,7 @@ struct clif_interface { void (*pRodexCancelWriteMail) (int fd, struct map_session_data *sd); void (*pRodexOpenMailbox) (int fd, struct map_session_data *sd); void (*pRodexCheckName) (int fd, struct map_session_data *sd); - void (*rodex_checkname_result) (struct map_session_data *sd, int char_id, short class_, int base_level, const char *name); + void (*rodex_checkname_result) (struct map_session_data *sd, int char_id, int class_, int base_level, const char *name); void (*pRodexDeleteMail) (int fd, struct map_session_data *sd); void (*rodex_delete_mail) (struct map_session_data *sd, int8 opentype, int64 mail_id); void (*pRodexRefreshMaillist) (int fd, struct map_session_data *sd); diff --git a/src/map/guild.c b/src/map/guild.c index 17bf7fa6b..0517887d3 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -1018,7 +1018,7 @@ static int guild_send_memberinfoshort(struct map_session_data *sd, int online) } // cleaned up [LuzZza] -static int guild_recv_memberinfoshort(int guild_id, int account_id, int char_id, int online, int lv, int16 class, uint32 last_login) +static int guild_recv_memberinfoshort(int guild_id, int account_id, int char_id, int online, int lv, int class, uint32 last_login) { int i, alv, c, idx = INDEX_NOT_FOUND, om = 0, oldonline = -1; struct guild *g = guild->search(guild_id); diff --git a/src/map/guild.h b/src/map/guild.h index 3df86a3ca..396cbda86 100644 --- a/src/map/guild.h +++ b/src/map/guild.h @@ -126,7 +126,7 @@ struct guild_interface { int (*check_alliance) (int guild_id1, int guild_id2, int flag); /* */ int (*send_memberinfoshort) (struct map_session_data *sd,int online); - int (*recv_memberinfoshort) (int guild_id, int account_id, int char_id, int online, int lv, int16 class, uint32 last_login); + int (*recv_memberinfoshort) (int guild_id, int account_id, int char_id, int online, int lv, int class, uint32 last_login); int (*change_memberposition) (int guild_id,int account_id,int char_id,short idx); int (*memberposition_changed) (struct guild *g,int idx,int pos); int (*change_position) (int guild_id,int idx,int mode,int exp_mode,const char *name); diff --git a/src/map/homunculus.c b/src/map/homunculus.c index 6df272243..aa3bb5360 100644 --- a/src/map/homunculus.c +++ b/src/map/homunculus.c @@ -411,7 +411,7 @@ static bool homunculus_levelup(struct homun_data *hd) return true; } -static int homunculus_change_class(struct homun_data *hd, short class_) +static int homunculus_change_class(struct homun_data *hd, int class_) { int i = homun->db_search(class_,HOMUNCULUS_CLASS); nullpo_retr(0, hd); diff --git a/src/map/homunculus.h b/src/map/homunculus.h index f0a156fd7..745c7cd84 100644 --- a/src/map/homunculus.h +++ b/src/map/homunculus.h @@ -174,7 +174,7 @@ struct homunculus_interface { int (*skill_tree_get_max) (int id, int b_class); void (*skillup) (struct homun_data *hd, uint16 skill_id); bool (*levelup) (struct homun_data *hd); - int (*change_class) (struct homun_data *hd, short class_); + int (*change_class) (struct homun_data *hd, int class_); bool (*evolve) (struct homun_data *hd); bool (*mutate) (struct homun_data *hd, int homun_id); int (*gainexp) (struct homun_data *hd, unsigned int exp); diff --git a/src/map/intif.c b/src/map/intif.c index ed4c0e2d2..a526e5ec0 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -71,7 +71,7 @@ static int CheckForCharServer(void) } // pet -static int intif_create_pet(int account_id, int char_id, short pet_class, short pet_lv, int pet_egg_id, +static int intif_create_pet(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, char *pet_name) { if (intif->CheckForCharServer()) @@ -903,7 +903,7 @@ static int intif_guild_leave(int guild_id, int account_id, int char_id, int flag } //Update request / Lv online status of the guild members -static int intif_guild_memberinfoshort(int guild_id, int account_id, int char_id, int online, int lv, int16 class) +static int intif_guild_memberinfoshort(int guild_id, int account_id, int char_id, int online, int lv, int class) { if (intif->CheckForCharServer()) return 0; diff --git a/src/map/intif.h b/src/map/intif.h index 21f7a494c..425ab1d18 100644 --- a/src/map/intif.h +++ b/src/map/intif.h @@ -58,7 +58,7 @@ struct intif_interface { int packet_len_table[INTIF_PACKET_LEN_TABLE_SIZE]; /* funcs */ int (*parse) (int fd); - int (*create_pet)(int account_id, int char_id, short pet_type, short pet_lv, int pet_egg_id, + int (*create_pet)(int account_id, int char_id, int pet_type, int pet_lv, int pet_egg_id, int pet_equip, short intimate, short hungry, char rename_flag, char incubate, char *pet_name); int (*broadcast) (const char *mes, int len, int type); int (*broadcast2) (const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY); @@ -84,7 +84,7 @@ struct intif_interface { int (*guild_request_info) (int guild_id); int (*guild_addmember) (int guild_id, struct guild_member *m); int (*guild_leave) (int guild_id, int account_id, int char_id, int flag, const char *mes); - int (*guild_memberinfoshort) (int guild_id, int account_id, int char_id, int online, int lv, int16 class); + int (*guild_memberinfoshort) (int guild_id, int account_id, int char_id, int online, int lv, int class); int (*guild_break) (int guild_id); int (*guild_message) (int guild_id, int account_id, const char *mes, int len); int (*guild_change_gm) (int guild_id, const char *name, int len); diff --git a/src/map/map.h b/src/map/map.h index d31ff4839..d96733f90 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -518,7 +518,7 @@ struct block_list { // Mob List Held in memory for Dynamic Mobs [Wizputer] // Expanded to specify all mob-related spawn data by [Skotlex] struct spawn_data { - short class_; ///< Class, used because a mob can change it's class + int class_; ///< Class, used because a mob can change it's class unsigned short m, x, y; ///< Spawn information (map, point, spawn-area around point) signed short xs, ys; unsigned short num; ///< Number of mobs using this structure diff --git a/src/map/mob.h b/src/map/mob.h index 4cb3877ed..cdfc07c7d 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -208,7 +208,7 @@ struct mob_data { struct spawn_data *spawn; //Spawn data. int spawn_timer; //Required for Convex Mirror struct item *lootitem; - short class_; + int class_; unsigned int tdmg; //Stores total damage given to the mob, for exp calculations. [Skotlex] int level; int target_id,attacked_id; diff --git a/src/map/npc.c b/src/map/npc.c index 7e1dab1b2..61341744d 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2961,7 +2961,7 @@ static bool npc_viewisid(const char *viewid) * @param class_ The NPC view class. * @return A pointer to the created NPC data (ownership passed to the caller). */ -static struct npc_data *npc_create_npc(enum npc_subtype subtype, int m, int x, int y, uint8 dir, int16 class_) +static struct npc_data *npc_create_npc(enum npc_subtype subtype, int m, int x, int y, uint8 dir, int class_) { struct npc_data *nd; @@ -3918,7 +3918,7 @@ static void npc_setdisplayname(struct npc_data *nd, const char *newname) /// /// @param nd Target npc /// @param class_ New display class -static void npc_setclass(struct npc_data *nd, short class_) +static void npc_setclass(struct npc_data *nd, int class_) { nullpo_retv(nd); @@ -4199,7 +4199,7 @@ static const char *npc_parse_mob(const char *w1, const char *w2, const char *w3, mobspawn.num = (unsigned short)num; mobspawn.active = 0; - mobspawn.class_ = (short) class_; + mobspawn.class_ = class_; mobspawn.x = (unsigned short)x; mobspawn.y = (unsigned short)y; mobspawn.xs = (signed short)xs; diff --git a/src/map/npc.h b/src/map/npc.h index d455a395b..0eb8befd1 100644 --- a/src/map/npc.h +++ b/src/map/npc.h @@ -77,7 +77,7 @@ struct npc_data { struct view_data vd; unsigned int option; struct npc_data *master_nd; - short class_; + int class_; short speed; char name[NAME_LENGTH+1];// display name char exname[NAME_LENGTH+1];// unique npc name @@ -268,7 +268,7 @@ struct npc_interface { void (*parsename) (struct npc_data *nd, const char *name, const char *start, const char *buffer, const char *filepath); int (*parseview) (const char *w4, const char *start, const char *buffer, const char *filepath); bool (*viewisid) (const char *viewid); - struct npc_data *(*create_npc) (enum npc_subtype subtype, int m, int x, int y, uint8 dir, int16 class_); + struct npc_data *(*create_npc) (enum npc_subtype subtype, int m, int x, int y, uint8 dir, int class_); struct npc_data* (*add_warp) (char *name, short from_mapid, short from_x, short from_y, short xs, short ys, unsigned short to_mapindex, short to_x, short to_y); const char *(*parse_warp) (const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); const char *(*parse_shop) (const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); @@ -288,7 +288,7 @@ struct npc_interface { void (*unsetcells) (struct npc_data *nd); void (*movenpc) (struct npc_data *nd, int16 x, int16 y); void (*setdisplayname) (struct npc_data *nd, const char *newname); - void (*setclass) (struct npc_data *nd, short class_); + void (*setclass) (struct npc_data *nd, int class_); int (*do_atcmd_event) (struct map_session_data *sd, const char *command, const char *message, const char *eventname); const char *(*parse_function) (const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); void (*parse_mob2) (struct spawn_data *mobspawn); diff --git a/src/map/pc.c b/src/map/pc.c index 5410ae96a..ea18715bb 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -6147,7 +6147,7 @@ static int pc_checkequip(struct map_session_data *sd, int pos) * Convert's from the client's lame Job ID system * to the map server's 'makes sense' system. [Skotlex] *------------------------------------------*/ -static int pc_jobid2mapid(int16 class) +static int pc_jobid2mapid(int class) { switch (class) { //Novice And 1-1 Jobs @@ -6289,9 +6289,9 @@ static int pc_jobid2mapid(int16 class) } //Reverts the map-style class id to the client-style one. -static int pc_mapid2jobid(uint16 job, int sex) +static int pc_mapid2jobid(unsigned int class, int sex) { - switch (job) { + switch (class) { //Novice And 1-1 Jobs case MAPID_NOVICE: return JOB_NOVICE; case MAPID_SWORDMAN: return JOB_SWORDMAN; diff --git a/src/map/pc.h b/src/map/pc.h index a2971b4f8..b2069d4df 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -1068,8 +1068,8 @@ END_ZEROED_BLOCK; /* End */ void (*setstand) (struct map_session_data *sd); int (*candrop) (struct map_session_data *sd,struct item *item); - int (*jobid2mapid) (int16 class); // Skotlex - int (*mapid2jobid) (unsigned short class_, int sex); // Skotlex + int (*jobid2mapid) (int class); // Skotlex + int (*mapid2jobid) (unsigned int class_, int sex); // Skotlex const char * (*job_name) (int class); diff --git a/src/map/pet.c b/src/map/pet.c index dd9f1ebbf..c9603a76c 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -111,8 +111,8 @@ static int pet_create_egg(struct map_session_data *sd, int item_id) if (!pc->inventoryblank(sd)) return 0; // Inventory full sd->catch_target_class = pet->db[pet_id].class_; intif->create_pet(sd->status.account_id, sd->status.char_id, - (short)pet->db[pet_id].class_, - (short)mob->db(pet->db[pet_id].class_)->lv, + pet->db[pet_id].class_, + mob->db(pet->db[pet_id].class_)->lv, pet->db[pet_id].EggID, 0, (short)pet->db[pet_id].intimate, 100, 0, 1, pet->db[pet_id].jname); @@ -614,7 +614,7 @@ static int pet_catch_process2(struct map_session_data *sd, int target_id) * pet_id - Should contain pet id otherwise means failure * returns true on success **/ -static bool pet_get_egg(int account_id, short pet_class, int pet_id) +static bool pet_get_egg(int account_id, int pet_class, int pet_id) { struct map_session_data *sd; struct item tmp_item; diff --git a/src/map/pet.h b/src/map/pet.h index 049816804..2508a70a6 100644 --- a/src/map/pet.h +++ b/src/map/pet.h @@ -37,7 +37,7 @@ struct pet_evolve_data { }; struct s_pet_db { - short class_; + int class_; char name[NAME_LENGTH],jname[NAME_LENGTH]; int itemID; int EggID; @@ -160,7 +160,7 @@ struct pet_interface { int (*select_egg) (struct map_session_data *sd, int egg_index); int (*catch_process1) (struct map_session_data *sd, int target_class); int (*catch_process2) (struct map_session_data *sd, int target_id); - bool (*get_egg) (int account_id, short pet_class, int pet_id ); + bool (*get_egg) (int account_id, int pet_class, int pet_id ); int (*unequipitem) (struct map_session_data *sd, struct pet_data *pd); int (*food) (struct map_session_data *sd, struct pet_data *pd); int (*ai_sub_hard_lootsearch) (struct block_list *bl, va_list ap); diff --git a/src/map/rodex.c b/src/map/rodex.c index eea27b6d0..33070c5f8 100644 --- a/src/map/rodex.c +++ b/src/map/rodex.c @@ -204,7 +204,7 @@ static void rodex_remove_item(struct map_session_data *sd, int16 idx, int16 amou /// @param base_level : Reference to return the character base level, if he exists /// @param char_id : Reference to return the character id, if he exists /// @param class : Reference to return the character class id, if he exists -static void rodex_check_player(struct map_session_data *sd, const char *name, int *base_level, int *char_id, short *class) +static void rodex_check_player(struct map_session_data *sd, const char *name, int *base_level, int *char_id, int *class) { intif->rodex_checkname(sd, name); } diff --git a/src/map/rodex.h b/src/map/rodex.h index ddf7cb32b..56cc3a9d1 100644 --- a/src/map/rodex.h +++ b/src/map/rodex.h @@ -65,7 +65,7 @@ struct rodex_interface { void (*refresh) (struct map_session_data *sd, int8 open_type, int64 first_mail_id); void (*add_item) (struct map_session_data *sd, int16 idx, int16 amount); void (*remove_item) (struct map_session_data *sd, int16 idx, int16 amount); - void (*check_player) (struct map_session_data *sd, const char *name, int *base_level, int *char_id, short *class); + void (*check_player) (struct map_session_data *sd, const char *name, int *base_level, int *char_id, int *class); int (*send_mail) (struct map_session_data *sd, const char *receiver_name, const char *body, const char *title, int64 zeny); void (*send_mail_result) (struct map_session_data *ssd, struct map_session_data *rsd, bool result); struct rodex_message *(*get_mail) (struct map_session_data *sd, int64 mail_id); diff --git a/src/map/script.c b/src/map/script.c index 76d15d8f1..7578fcdcc 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -10733,7 +10733,7 @@ static BUILDIN(makepet) if (pet_id >= 0 && sd) { sd->catch_target_class = pet->db[pet_id].class_; intif->create_pet(sd->status.account_id, sd->status.char_id, - (short)pet->db[pet_id].class_, (short)mob->db(pet->db[pet_id].class_)->lv, + pet->db[pet_id].class_, mob->db(pet->db[pet_id].class_)->lv, pet->db[pet_id].EggID, 0, (short)pet->db[pet_id].intimate, 100, 0, 1, pet->db[pet_id].jname); } -- cgit v1.2.3-70-g09d2