diff options
author | Haru <haru@dotalux.com> | 2019-02-11 02:00:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-11 02:00:58 +0100 |
commit | 2d8a44b753832610d23678629127369f5db576a3 (patch) | |
tree | 258e78c458642cc017837f674b0d23255ac49bf4 /src/map | |
parent | 68126f7d762e001b1a34cfe5e0a340db9c7d9da8 (diff) | |
parent | dbaa9ac111496fdfde9948d5cb15a0b052843b3f (diff) | |
download | hercules-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/map')
-rw-r--r-- | src/map/atcommand.c | 2 | ||||
-rw-r--r-- | src/map/battle.c | 4 | ||||
-rw-r--r-- | src/map/clif.c | 6 | ||||
-rw-r--r-- | src/map/clif.h | 2 | ||||
-rw-r--r-- | src/map/guild.c | 2 | ||||
-rw-r--r-- | src/map/guild.h | 2 | ||||
-rw-r--r-- | src/map/homunculus.c | 2 | ||||
-rw-r--r-- | src/map/homunculus.h | 2 | ||||
-rw-r--r-- | src/map/intif.c | 46 | ||||
-rw-r--r-- | src/map/intif.h | 4 | ||||
-rw-r--r-- | src/map/map.h | 4 | ||||
-rw-r--r-- | src/map/mob.h | 2 | ||||
-rw-r--r-- | src/map/npc.c | 6 | ||||
-rw-r--r-- | src/map/npc.h | 6 | ||||
-rw-r--r-- | src/map/pc.c | 6 | ||||
-rw-r--r-- | src/map/pc.h | 108 | ||||
-rw-r--r-- | src/map/pet.c | 6 | ||||
-rw-r--r-- | src/map/pet.h | 4 | ||||
-rw-r--r-- | src/map/rodex.c | 2 | ||||
-rw-r--r-- | src/map/rodex.h | 2 | ||||
-rw-r--r-- | src/map/script.c | 2 |
21 files changed, 110 insertions, 110 deletions
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..18b41fe04 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()) @@ -81,16 +81,16 @@ static int intif_create_pet(int account_id, int char_id, short pet_class, short WFIFOW(inter_fd, 0) = 0x3080; WFIFOL(inter_fd, 2) = account_id; WFIFOL(inter_fd, 6) = char_id; - WFIFOW(inter_fd, 10) = pet_class; - WFIFOW(inter_fd, 12) = pet_lv; - WFIFOL(inter_fd, 14) = pet_egg_id; - WFIFOL(inter_fd, 18) = pet_equip; - WFIFOW(inter_fd, 22) = intimate; - WFIFOW(inter_fd, 24) = hungry; - WFIFOB(inter_fd, 26) = rename_flag; - WFIFOB(inter_fd, 27) = incubate; - memcpy(WFIFOP(inter_fd, 28), pet_name, NAME_LENGTH); - WFIFOSET(inter_fd, 28 + NAME_LENGTH); + WFIFOL(inter_fd, 10) = pet_class; + WFIFOL(inter_fd, 14) = pet_lv; + WFIFOL(inter_fd, 18) = pet_egg_id; + WFIFOL(inter_fd, 22) = pet_equip; + WFIFOW(inter_fd, 26) = intimate; + WFIFOW(inter_fd, 28) = hungry; + WFIFOB(inter_fd, 30) = rename_flag; + WFIFOB(inter_fd, 31) = incubate; + memcpy(WFIFOP(inter_fd, 32), pet_name, NAME_LENGTH); + WFIFOSET(inter_fd, 32 + NAME_LENGTH); return 0; } @@ -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; @@ -913,9 +913,9 @@ static int intif_guild_memberinfoshort(int guild_id, int account_id, int char_id WFIFOL(inter_fd, 6) = account_id; WFIFOL(inter_fd,10) = char_id; WFIFOB(inter_fd,14) = online; - WFIFOW(inter_fd,15) = lv; - WFIFOW(inter_fd,17) = class; - WFIFOSET(inter_fd,19); + WFIFOL(inter_fd,15) = lv; + WFIFOL(inter_fd,19) = class; + WFIFOSET(inter_fd,23); return 0; } @@ -1507,7 +1507,7 @@ static void intif_parse_GuildMemberWithdraw(int fd) // ACK guild member basic info static void intif_parse_GuildMemberInfoShort(int fd) { - guild->recv_memberinfoshort(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOW(fd,15),RFIFOW(fd,17),RFIFOL(fd,19)); + guild->recv_memberinfoshort(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOW(fd,15),RFIFOL(fd,17),RFIFOL(fd,19)); } // ACK guild break @@ -1640,7 +1640,7 @@ static void intif_parse_GuildMasterChanged(int fd) // Request pet creation static void intif_parse_CreatePet(int fd) { - pet->get_egg(RFIFOL(fd,2), RFIFOW(fd,6), RFIFOL(fd,8)); + pet->get_egg(RFIFOL(fd, 2), RFIFOL(fd, 6), RFIFOL(fd, 10)); } // ACK pet data @@ -2830,11 +2830,11 @@ static void intif_parse_RodexCheckName(int fd) struct map_session_data *sd = NULL; int reqchar_id = RFIFOL(fd, 2); int target_char_id = RFIFOL(fd, 6); - short target_class = RFIFOW(fd, 10); - int target_level = RFIFOL(fd, 12); + int target_class = RFIFOL(fd, 10); + int target_level = RFIFOL(fd, 14); char name[NAME_LENGTH]; - safestrncpy(name, RFIFOP(inter_fd, 16), NAME_LENGTH); + safestrncpy(name, RFIFOP(inter_fd, 18), NAME_LENGTH); if (reqchar_id <= 0) return; @@ -2995,13 +2995,13 @@ void intif_defaults(void) -1,-1,27,-1, -1,-1,37,-1, 7, 0, 0, 0, 0, 0, 0, 0, //0x3800-0x380f -1, 0, 0, 0, 0, 0, 0, 0, -1,11, 0, 0, 0, 0, 0, 0, //0x3810 Achievements [Smokexyz/Hercules] 39,-1,15,15, 14,19, 7,-1, 0, 0, 0, 0, 0, 0, 0, 0, //0x3820 - 10,-1,15, 0, 79,23, 7,-1, 0,-1,-1,-1, 14,67,186,-1, //0x3830 + 10,-1,15, 0, 79,25, 7,-1, 0,-1,-1,-1, 14,67,186,-1, //0x3830 -1, 0, 0,14, 0, 0, 0, 0, -1,74,-1,11, 11,-1, 0, 0, //0x3840 -1,-1, 7, 7, 7,11, 8, 0, 10, 0, 0, 0, 0, 0, 0, 0, //0x3850 Auctions [Zephyrus] itembound[Akinari] Clan System[Murilo BiO] -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3860 Quests [Kevin] [Inkfish] -1, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 3, 3, 0, //0x3870 Mercenaries [Zephyrus] / Elemental [pakpil] - 12,-1, 7, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3880 - -1,-1, 7, 3, 0,-1, 7, 15,16 + NAME_LENGTH, 0, 0, 0, 0, 0, 0, 0, //0x3890 Homunculus [albator] / RoDEX [KirieZ] + 14,-1, 7, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3880 + -1,-1, 7, 3, 0,-1, 7, 15,18 + NAME_LENGTH, 0, 0, 0, 0, 0, 0, 0, //0x3890 Homunculus [albator] / RoDEX [KirieZ] }; intif = &intif_s; 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..ace2a35a1 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 @@ -800,7 +800,7 @@ struct questinfo { unsigned short icon; unsigned char color; bool hasJob; - unsigned short job;/* perhaps a mapid mask would be most flexible? */ + unsigned int job;/* perhaps a mapid mask would be most flexible? */ bool sex_enabled; int sex; struct { 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 90e59edb2..b2069d4df 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -117,22 +117,22 @@ BEGIN_ZEROED_BLOCK; // all the variables within this block get zero'ed in each c int addrace2[RC2_MAX]; int addsize[3]; struct drain_data { - short rate; - short per; - short value; + int rate; + int per; + int value; unsigned type:1; } hp_drain[RC_MAX], sp_drain[RC_MAX]; struct { - short class_, rate; + int class_, rate; } add_dmg[MAX_PC_BONUS]; struct { - short flag, rate; + int flag, rate; unsigned char ele; } addele2[MAX_PC_BONUS]; END_ZEROED_BLOCK; }; struct s_autospell { - short id, lv, rate, flag; + int id, lv, rate, flag; int card_id; bool lock; // bAutoSpellOnSkill: blocks autospell from triggering again, while being executed }; @@ -147,7 +147,7 @@ struct s_addeffect { }; struct s_addeffectonskill { enum sc_type id; - short rate, skill; + int rate, skill; unsigned char target; }; struct s_add_drop { @@ -156,11 +156,11 @@ struct s_add_drop { int race, rate; }; struct s_autobonus { - short rate,atk_type; + int rate,atk_type; unsigned int duration; char *bonus_script, *other_script; int active; - unsigned short pos; + unsigned int pos; }; enum npc_timeout_type { NPCT_INPUT = 0, @@ -219,11 +219,11 @@ struct map_session_data { unsigned int changemap : 1; unsigned int callshop : 1; // flag to indicate that a script used callshop; on a shop short pmap; // Previous map on Map Change - unsigned short autoloot; + unsigned int autoloot; int autolootid[AUTOLOOTITEM_SIZE]; // [Zephyrus] - unsigned short autoloottype; + unsigned int autoloottype; unsigned int autolooting : 1; //performance-saver, autolooting state for @alootid - unsigned short autobonus; //flag to indicate if an autobonus is activated. [Inkfish] + unsigned int autobonus; //flag to indicate if an autobonus is activated. [Inkfish] unsigned int gmaster_flag : 1; unsigned int prevend : 1;//used to flag wheather you've spent 40sp to open the vending or not. unsigned int warping : 1;//states whether you're in the middle of a warp processing @@ -288,7 +288,7 @@ struct map_session_data { int followtimer; // [MouseJstr] int followtarget; time_t emotionlasttime; // to limit flood with emotion packets - short skillitem,skillitemlv; + int skillitem,skillitemlv; uint16 skill_id_old,skill_lv_old; uint16 skill_id_dance,skill_lv_dance; short cook_mastery; // range: [0,1999] [Inkfish] @@ -312,7 +312,7 @@ struct map_session_data { int16 weapontype; ///< Weapon type considering both hands (@see enum weapon_type). int16 weapontype1; ///< Weapon type in the right/primary hand (@see enum weapon_type). int16 weapontype2; ///< Weapon type in the left/secondary hand (@see enum weapon_type). - short disguise; // [Valaris] + int disguise; // [Valaris] struct weapon_data right_weapon, left_weapon; BEGIN_ZEROED_BLOCK; // this block will be globally zeroed at the beginning of status_calc_pc() @@ -337,9 +337,9 @@ BEGIN_ZEROED_BLOCK; // this block will be globally zeroed at the beginning of st int expaddrace[RC_MAX]; int ignore_mdef[RC_MAX]; int ignore_def[RC_MAX]; - short sp_gain_race[RC_MAX]; - short sp_gain_race_attack[RC_MAX]; - short hp_gain_race_attack[RC_MAX]; + int sp_gain_race[RC_MAX]; + int sp_gain_race_attack[RC_MAX]; + int hp_gain_race_attack[RC_MAX]; #ifdef RENEWAL int race_tolerance[RC_MAX]; #endif @@ -347,16 +347,16 @@ BEGIN_ZEROED_BLOCK; // this block will be globally zeroed at the beginning of st struct s_addeffect addeff[MAX_PC_BONUS], addeff2[MAX_PC_BONUS]; struct s_addeffectonskill addeff3[MAX_PC_BONUS]; struct { //skillatk raises bonus dmg% of skills, skillheal increases heal%, skillblown increases bonus blewcount for some skills. - unsigned short id; - short val; + unsigned int id; + int val; } skillatk[MAX_PC_BONUS], skillusesprate[MAX_PC_BONUS], skillusesp[MAX_PC_BONUS], skillheal[5], skillheal2[5], skillblown[MAX_PC_BONUS], skillcast[MAX_PC_BONUS], skillcooldown[MAX_PC_BONUS], skillfixcast[MAX_PC_BONUS], skillvarcast[MAX_PC_BONUS], skillfixcastrate[MAX_PC_BONUS]; struct { - short value; + int value; int rate; int tick; } hp_loss, sp_loss, hp_regen, sp_regen; struct { - short class_, rate; + int class_, rate; } add_def[MAX_PC_BONUS], add_mdef[MAX_PC_BONUS], add_mdmg[MAX_PC_BONUS]; struct s_add_drop add_drop[MAX_PC_BONUS]; struct { @@ -364,11 +364,11 @@ BEGIN_ZEROED_BLOCK; // this block will be globally zeroed at the beginning of st int rate; } itemhealrate[MAX_PC_BONUS]; struct { - short flag, rate; + int flag, rate; unsigned char ele; } subele2[MAX_PC_BONUS]; struct { - short value; + int value; int rate, tick; } def_set_race[RC_MAX], mdef_set_race[RC_MAX]; struct { @@ -394,17 +394,17 @@ BEGIN_ZEROED_BLOCK; // this block will be globally zeroed at the beginning of st int itemhealrate2; // [Epoque] Increase heal rate of all healing items. int shieldmdef;//royal guard's unsigned int setitem_hash, setitem_hash2; //Split in 2 because shift operations only work on int ranges. [Skotlex] - short splash_range, splash_add_range; - short add_steal_rate; - short add_heal_rate, add_heal2_rate; - short sp_gain_value, hp_gain_value, magic_sp_gain_value, magic_hp_gain_value; - short hp_vanish_rate; - short hp_vanish_per, hp_vanish_trigger; - short sp_vanish_rate; - short sp_vanish_per, sp_vanish_trigger; - unsigned short unbreakable; // chance to prevent ANY equipment breaking [celest] - unsigned short unbreakable_equip; //100% break resistance on certain equipment - unsigned short unstripable_equip; + int splash_range, splash_add_range; + int add_steal_rate; + int add_heal_rate, add_heal2_rate; + int sp_gain_value, hp_gain_value, magic_sp_gain_value, magic_hp_gain_value; + int hp_vanish_rate; + int hp_vanish_per, hp_vanish_trigger; + int sp_vanish_rate; + int sp_vanish_per, sp_vanish_trigger; + unsigned int unbreakable; // chance to prevent ANY equipment breaking [celest] + unsigned int unbreakable_equip; //100% break resistance on certain equipment + unsigned int unstripable_equip; int fixcastrate,varcastrate; int add_fixcast,add_varcast; int ematk; // matk bonus from equipment @@ -419,22 +419,22 @@ END_ZEROED_BLOCK; int matk_rate; int critical_rate,hit_rate,flee_rate,flee2_rate,def_rate,def2_rate,mdef_rate,mdef2_rate; int itemid; - short itemindex; //Used item's index in sd->inventory [Skotlex] - short catch_target_class; // pet catching, stores a pet class to catch (short now) [zzo] - short spiritball, spiritball_old; + int itemindex; //Used item's index in sd->inventory [Skotlex] + int catch_target_class; + int spiritball, spiritball_old; int spirit_timer[MAX_SPIRITBALL]; - short charm_count; + int charm_count; int charm_type; int charm_timer[MAX_SPIRITCHARM]; unsigned char potion_success_counter; //Potion successes in row counter unsigned char mission_count; //Stores the bounty kill count for TK_MISSION - short mission_mobid; //Stores the target mob_id for TK_MISSION + int mission_mobid; //Stores the target mob_id for TK_MISSION int die_counter; //Total number of times you've died int devotion[MAX_PC_DEVOTION]; //Stores the account IDs of chars devoted to. int trade_partner; struct { struct { - short index, amount; + int index, amount; } item[10]; int zeny, weight; } deal; @@ -465,18 +465,18 @@ END_ZEROED_BLOCK; struct { int m; //-1 - none, other: map index corresponding to map name. - unsigned short index; //map index + unsigned int index; //map index } feel_map[MAX_PC_FEELHATE];// 0 - Sun; 1 - Moon; 2 - Stars - short hate_mob[MAX_PC_FEELHATE]; + int hate_mob[MAX_PC_FEELHATE]; int pvp_timer; - short pvp_point; - unsigned short pvp_rank, pvp_lastusers; - unsigned short pvp_won, pvp_lost; + int pvp_point; + unsigned int pvp_rank, pvp_lastusers; + unsigned int pvp_won, pvp_lost; char eventqueue[MAX_EVENTQUEUE][EVENT_NAME_LENGTH]; int eventtimer[MAX_EVENTTIMER]; - unsigned short eventcount; // [celest] + unsigned int eventcount; // [celest] int change_level_2nd; // job level when changing from 1st to 2nd class [jobchange_level in global_reg_value] int change_level_3rd; // job level when changing from 2nd to 3rd class [jobchange_level_3rd in global_reg_value] @@ -769,24 +769,24 @@ END_ZEROED_BLOCK; #define pc_can_give_bound_items(sd) ( pc_has_permission((sd),PC_PERM_TRADE_BOUND) ) struct skill_tree_requirement { - short id; + int id; unsigned short idx; unsigned char lv; }; struct skill_tree_entry { - short id; + int id; unsigned short idx; unsigned char max; unsigned char joblv; - short inherited; + int inherited; VECTOR_DECL(struct skill_tree_requirement) need; }; // Celest struct sg_data { - short anger_id; - short bless_id; - short comfort_id; + int anger_id; + int bless_id; + int comfort_id; char feel_var[NAME_LENGTH]; char hate_var[NAME_LENGTH]; bool (*day_func)(void); @@ -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); } |