Skip to content

Commit

Permalink
Definition cleanup
Browse files Browse the repository at this point in the history
Removed a few ghost definitions
Adjusted some definitions to use the same types

Related to #1738
  • Loading branch information
Lemongrass3110 committed Nov 26, 2016
1 parent 82675d8 commit c88ca44
Show file tree
Hide file tree
Showing 23 changed files with 19 additions and 53 deletions.
4 changes: 0 additions & 4 deletions src/char/char.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,10 @@ int char_divorce_char_sql(int partner_id1, int partner_id2);
int char_memitemdata_to_sql(const struct item items[], int max, int id, enum storage_type tableswitch, uint8 stor_id);
bool char_memitemdata_from_sql(struct s_storage* p, int max, int id, enum storage_type tableswitch, uint8 stor_id);

void disconnect_player(uint32 account_id);

int char_married(int pl1,int pl2);
int char_child(int parent_id, int child_id);
int char_family(int pl1,int pl2,int pl3);

int char_request_accreg2(uint32 account_id, uint32 char_id);

//extern bool char_gm_read;
int char_loadName(uint32 char_id, char* name);
int char_check_char_name(char * name, char * esc_name);
Expand Down
2 changes: 0 additions & 2 deletions src/char/int_pet.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

struct s_pet;

int inter_pet_init(void);
void inter_pet_sql_final(void);
int inter_pet_save(void);
int inter_pet_delete(int pet_id);

int inter_pet_parse_frommap(int fd);
Expand Down
1 change: 0 additions & 1 deletion src/char/inter.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ int inter_init_sql(const char *file);
void inter_final(void);
int inter_parse_frommap(int fd);
int inter_mapif_init(int fd);
int mapif_send_gmaccounts(void);
int mapif_disconnectplayer(int fd, uint32 account_id, uint32 char_id, int reason);
void mapif_accinfo_ack(bool success, int map_fd, int u_fd, int u_aid, int account_id, int8 type,
int group_id, int logincount, int state, const char *email, const char *last_ip, const char *lastlogin,
Expand Down
2 changes: 1 addition & 1 deletion src/map/battle.c
Original file line number Diff line number Diff line change
Expand Up @@ -1965,7 +1965,7 @@ static int64 battle_calc_base_damage(struct status_data *status, struct weapon_a
* Initial refactoring by Baalberith
* Refined and optimized by helvetica
*/
void battle_consume_ammo(TBL_PC*sd, int skill, int lv)
void battle_consume_ammo(struct map_session_data*sd, int skill, int lv)
{
int qty = 1;

Expand Down
2 changes: 1 addition & 1 deletion src/map/chrif.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static bool chrif_auth_logout(TBL_PC* sd, enum sd_state state) {
return chrif_sd_to_auth(sd, state);
}

bool chrif_auth_finished(TBL_PC* sd) {
bool chrif_auth_finished(struct map_session_data* sd) {
struct auth_node *node= chrif_search(sd->status.account_id);

if ( node && node->sd == sd && node->state == ST_LOGIN ) {
Expand Down
3 changes: 1 addition & 2 deletions src/map/chrif.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,13 @@ int chrif_char_reset_offline(void);
int send_users_tochar(void);
int chrif_char_online(struct map_session_data *sd);
int chrif_changesex(struct map_session_data *sd, bool change_account);
int chrif_chardisconnect(struct map_session_data *sd);
int chrif_divorce(int partner_id1, int partner_id2);

int chrif_removefriend(uint32 char_id, int friend_id);

void chrif_parse_ack_vipActive(int fd);

int chrif_req_charban(int aid, const char* character_name, int timediff);
int chrif_req_charban(int aid, const char* character_name, int32 timediff);
int chrif_req_charunban(int aid, const char* character_name);

int chrif_bsdata_request(uint32 char_id);
Expand Down
4 changes: 0 additions & 4 deletions src/map/clif.h
Original file line number Diff line number Diff line change
Expand Up @@ -592,10 +592,6 @@ void clif_changechatstatus(struct chat_data* cd); // chat
void clif_refresh_storagewindow(struct map_session_data *sd);
void clif_refresh(struct map_session_data *sd); // self

void clif_fame_blacksmith(struct map_session_data *sd, int points);
void clif_fame_alchemist(struct map_session_data *sd, int points);
void clif_fame_taekwon(struct map_session_data *sd, int points);

void clif_emotion(struct block_list *bl,int type);
void clif_talkiebox(struct block_list* bl, const char* talkie);
void clif_wedding_effect(struct block_list *bl);
Expand Down
2 changes: 1 addition & 1 deletion src/map/guild.c
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,7 @@ int guild_getexp(struct map_session_data *sd,int exp) {
/*====================================================
* Ask to increase guildskill skill_id
*---------------------------------------------------*/
void guild_skillup(TBL_PC* sd, uint16 skill_id) {
void guild_skillup(struct map_session_data* sd, uint16 skill_id) {
struct guild* g;
short idx = guild_skill_get_index(skill_id);
short max = 0;
Expand Down
1 change: 0 additions & 1 deletion src/map/guild.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ void guild_skillup(struct map_session_data* sd, uint16 skill_id);
void guild_block_skill(struct map_session_data *sd, int time);
int guild_reqalliance(struct map_session_data *sd,struct map_session_data *tsd);
int guild_reply_reqalliance(struct map_session_data *sd,uint32 account_id,int flag);
int guild_alliance(int guild_id1,int guild_id2,uint32 account_id1,uint32 account_id2);
int guild_allianceack(int guild_id1,int guild_id2,uint32 account_id1,uint32 account_id2,
int flag,const char *name1,const char *name2);
int guild_delalliance(struct map_session_data *sd,int guild_id,int flag);
Expand Down
4 changes: 2 additions & 2 deletions src/map/intif.c
Original file line number Diff line number Diff line change
Expand Up @@ -1976,7 +1976,7 @@ QUESTLOG SYSTEM FUNCTIONS
* Requests a character's quest log entries to the inter server.
* @param sd Character's data
*/
void intif_request_questlog(TBL_PC *sd)
void intif_request_questlog(struct map_session_data *sd)
{
if (CheckForCharServer())
return;
Expand Down Expand Up @@ -2059,7 +2059,7 @@ void intif_parse_questsave(int fd)
* @param sd Character's data
* @return 0 in case of success, nonzero otherwise
*/
int intif_quest_save(TBL_PC *sd)
int intif_quest_save(struct map_session_data *sd)
{
int len = sizeof(struct quest) * sd->num_quests + 8;

Expand Down
1 change: 0 additions & 1 deletion src/map/itemdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,6 @@ struct item_combo *itemdb_combo_exists(unsigned short combo_id);

struct s_item_group_db *itemdb_group_exists(unsigned short group_id);
char itemdb_pc_get_itemgroup(uint16 group_id, struct map_session_data *sd);
uint16 itemdb_get_randgroupitem_count(uint16 group_id, uint8 sub_group, unsigned short nameid);

bool itemdb_parse_roulette_db(void);

Expand Down
3 changes: 1 addition & 2 deletions src/map/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ bool mapit_exists(struct s_mapiterator* mapit);
int map_check_dir(int s_dir,int t_dir);
uint8 map_calc_dir(struct block_list *src,int16 x,int16 y);
uint8 map_calc_dir_xy(int16 srcx, int16 srcy, int16 x, int16 y, uint8 srcdir);
int map_random_dir(struct block_list *bl, short *x, short *y); // [Skotlex]
int map_random_dir(struct block_list *bl, int16 *x, int16 *y); // [Skotlex]

int cleanup_sub(struct block_list *bl, va_list ap);

Expand All @@ -901,7 +901,6 @@ void map_iwall_remove(const char *wall_name);
int map_addmobtolist(unsigned short m, struct spawn_data *spawn); // [Wizputer]
void map_spawnmobs(int16 m); // [Wizputer]
void map_removemobs(int16 m); // [Wizputer]
void do_reconnect_map(void); //Invoked on map-char reconnection [Skotlex]
void map_addmap2db(struct map_data *m);
void map_removemapdb(struct map_data *m);

Expand Down
4 changes: 2 additions & 2 deletions src/map/mob.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ static int mob_spawn_guardian_sub(int tid, unsigned int tick, int id, intptr_t d
/*==========================================
* Summoning Guardians [Valaris]
*------------------------------------------*/
int mob_spawn_guardian(const char* mapname, short x, short y, const char* mobname, int mob_id, const char* event, int guardian, bool has_index)
int mob_spawn_guardian(const char* mapname, int16 x, int16 y, const char* mobname, int mob_id, const char* event, int guardian, bool has_index)
{
struct mob_data *md=NULL;
struct spawn_data data;
Expand Down Expand Up @@ -790,7 +790,7 @@ int mob_spawn_guardian(const char* mapname, short x, short y, const char* mobnam
/*==========================================
* Summoning BattleGround [Zephyrus]
*------------------------------------------*/
int mob_spawn_bg(const char* mapname, short x, short y, const char* mobname, int mob_id, const char* event, unsigned int bg_id)
int mob_spawn_bg(const char* mapname, int16 x, int16 y, const char* mobname, int mob_id, const char* event, unsigned int bg_id)
{
struct mob_data *md = NULL;
struct spawn_data data;
Expand Down
5 changes: 1 addition & 4 deletions src/map/mob.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,7 @@ int mobdb_searchname_array(struct mob_db** data, int size, const char *str);
int mobdb_checkid(const int id);
struct view_data* mob_get_viewdata(int mob_id);

struct mob_data *mob_once_spawn_sub(struct block_list *bl, int16 m,
short x, short y, const char *mobname, int mob_id, const char *event, unsigned int size, unsigned int ai);
struct mob_data *mob_once_spawn_sub(struct block_list *bl, int16 m, int16 x, int16 y, const char *mobname, int mob_id, const char *event, unsigned int size, unsigned int ai);

int mob_once_spawn(struct map_session_data* sd, int16 m, int16 x, int16 y,
const char* mobname, int mob_id, int amount, const char* event, unsigned int size, unsigned int ai);
Expand Down Expand Up @@ -339,8 +338,6 @@ int mob_linksearch(struct block_list *bl,va_list ap);

int mobskill_use(struct mob_data *md,unsigned int tick,int event);
int mobskill_event(struct mob_data *md,struct block_list *src,unsigned int tick, int flag);
int mobskill_castend_id( int tid, unsigned int tick, int id,int data );
int mobskill_castend_pos( int tid, unsigned int tick, int id,int data );
int mob_summonslave(struct mob_data *md2,int *value,int amount,uint16 skill_id);
int mob_countslave(struct block_list *bl);
int mob_count_sub(struct block_list *bl, va_list ap);
Expand Down
1 change: 0 additions & 1 deletion src/map/npc.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ void do_clear_npc(void);
void do_final_npc(void);
void do_init_npc(void);
void npc_event_do_oninit(void);
int npc_do_ontimer(int npc_id, int option);

int npc_event_do(const char* name);
int npc_event_do_id(const char* name, int rid);
Expand Down
8 changes: 4 additions & 4 deletions src/map/pc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4005,7 +4005,7 @@ void pc_bonus5(struct map_session_data *sd,int type,int type2,int type3,int type
* 2 - Like 1, except the level granted can stack with previously learned level.
* 4 - Like 0, except the skill will ignore skill tree (saves through job changes and resets).
*------------------------------------------*/
bool pc_skill(TBL_PC* sd, uint16 skill_id, int level, enum e_addskill_type type) {
bool pc_skill(struct map_session_data* sd, uint16 skill_id, int level, enum e_addskill_type type) {
uint16 idx = 0;
nullpo_ret(sd);

Expand Down Expand Up @@ -8789,7 +8789,7 @@ bool pc_setcart(struct map_session_data *sd,int type) {
/*==========================================
* Give player a falcon
*------------------------------------------*/
void pc_setfalcon(TBL_PC* sd, int flag)
void pc_setfalcon(struct map_session_data* sd, int flag)
{
if( flag ){
if( pc_checkskill(sd,HT_FALCON)>0 ) // add falcon if he have the skill
Expand All @@ -8802,7 +8802,7 @@ void pc_setfalcon(TBL_PC* sd, int flag)
/*==========================================
* Set player riding
*------------------------------------------*/
void pc_setriding(TBL_PC* sd, int flag)
void pc_setriding(struct map_session_data* sd, int flag)
{
if( &sd->sc && sd->sc.data[SC_ALL_RIDING] )
return;
Expand All @@ -8818,7 +8818,7 @@ void pc_setriding(TBL_PC* sd, int flag)
/*==========================================
* Give player a mado
*------------------------------------------*/
void pc_setmadogear(TBL_PC* sd, int flag)
void pc_setmadogear(struct map_session_data* sd, int flag)
{
if( flag ){
if( pc_checkskill(sd,NC_MADOLICENCE) > 0 )
Expand Down
3 changes: 1 addition & 2 deletions src/map/pc.h
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,6 @@ int pc_split_atoi(char* str, int* val, char sep, int max);
int pc_class2idx(int class_);
int pc_get_group_level(struct map_session_data *sd);
int pc_get_group_id(struct map_session_data *sd);
int pc_getrefinebonus(int lv,int type);
bool pc_can_give_items(struct map_session_data *sd);
bool pc_can_give_bounded_items(struct map_session_data *sd);

Expand Down Expand Up @@ -983,7 +982,7 @@ bool pc_checkequip2(struct map_session_data *sd, unsigned short nameid, int min,
void pc_scdata_received(struct map_session_data *sd);
void pc_check_expiration(struct map_session_data *sd);
int pc_expiration_timer(int tid, unsigned int tick, int id, intptr_t data);
int pc_global_expiration_timer(int tid, unsigned tick, int id, intptr_t data);
int pc_global_expiration_timer(int tid, unsigned int tick, int id, intptr_t data);
void pc_expire_check(struct map_session_data *sd);

void pc_calc_skilltree(struct map_session_data *sd);
Expand Down
1 change: 0 additions & 1 deletion src/map/quest.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ int quest_update_objective_sub(struct block_list *bl, va_list ap);
void quest_update_objective(TBL_PC * sd, int mob_id);
int quest_update_status(TBL_PC * sd, int quest_id, enum quest_state status);
int quest_check(TBL_PC * sd, int quest_id, enum quest_check_type type);
void quest_clear(void);

struct quest_db *quest_search(int quest_id);

Expand Down
2 changes: 1 addition & 1 deletion src/map/script.c
Original file line number Diff line number Diff line change
Expand Up @@ -3095,7 +3095,7 @@ int set_reg(struct script_state* st, TBL_PC* sd, int64 num, const char* name, co
}
}

int set_var(TBL_PC* sd, char* name, void* val)
int set_var(struct map_session_data* sd, char* name, void* val)
{
return set_reg(NULL, sd, reference_uid(add_str(name),0), name, val, NULL);
}
Expand Down
2 changes: 0 additions & 2 deletions src/map/script.h
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,6 @@ void script_error(const char* src, const char* file, int start_line, const char*
void script_warning(const char* src, const char* file, int start_line, const char* error_msg, const char* error_pos);

struct script_code* parse_script(const char* src,const char* file,int line,int options);
void run_script_sub(struct script_code *rootscript,int pos,int rid,int oid, char* file, int lineno);
void run_script(struct script_code *rootscript,int pos,int rid,int oid);

int set_reg(struct script_state* st, TBL_PC* sd, int64 num, const char* name, const void* value, struct reg_db *ref);
Expand All @@ -669,7 +668,6 @@ int run_script_timer(int tid, unsigned int tick, int id, intptr_t data);
void run_script_main(struct script_state *st);

void script_stop_instances(struct script_code *code);
struct linkdb_node* script_erase_sleepdb(struct linkdb_node *n);
void script_free_code(struct script_code* code);
void script_free_vars(struct DBMap *storage);
struct script_state* script_alloc_state(struct script_code* rootscript, int pos, int rid, int oid);
Expand Down
11 changes: 1 addition & 10 deletions src/map/skill.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ int skill_break_equip(struct block_list *src,struct block_list *bl, unsigned sho
int skill_strip_equip(struct block_list *src,struct block_list *bl, unsigned short where, int rate, int lv, int time);
// Skills unit
struct skill_unit_group *skill_id2group(int group_id);
struct skill_unit_group *skill_unitsetting(struct block_list* src, uint16 skill_id, uint16 skill_lv, short x, short y, int flag);
struct skill_unit_group *skill_unitsetting(struct block_list* src, uint16 skill_id, uint16 skill_lv, int16 x, int16 y, int flag);
struct skill_unit *skill_initunit (struct skill_unit_group *group, int idx, int x, int y, int val1, int val2, bool hidden);
int skill_delunit(struct skill_unit *unit);
struct skill_unit_group *skill_initunitgroup(struct block_list* src, int count, uint16 skill_id, uint16 skill_lv, int unit_id, int limit, int interval);
Expand Down Expand Up @@ -469,20 +469,11 @@ struct skill_condition skill_get_requirement(struct map_session_data *sd, uint16
int skill_disable_check(struct status_change *sc, uint16 skill_id);

int skill_check_pc_partner(struct map_session_data *sd, uint16 skill_id, uint16 *skill_lv, int range, int cast_flag);
// -- moonsoul (added skill_check_unit_cell)
int skill_check_unit_cell(uint16 skill_id,int16 m,int16 x,int16 y,int unit_id);
int skill_unit_out_all( struct block_list *bl,unsigned int tick,int range);
int skill_unit_move(struct block_list *bl,unsigned int tick,int flag);
void skill_unit_move_unit_group( struct skill_unit_group *group, int16 m,int16 dx,int16 dy);
void skill_unit_move_unit(struct block_list *bl, int dx, int dy);

struct skill_unit_group *skill_check_dancing( struct block_list *src );

// Chant canceled
int skill_castcancel(struct block_list *bl,int type);

int skill_sit (struct map_session_data *sd, int type);
void skill_overbrand(struct block_list* src, uint16 skill_id, uint16 skill_lv, uint16 x, uint16 y, unsigned int tick, int flag);
void skill_repairweapon(struct map_session_data *sd, int idx);
void skill_identify(struct map_session_data *sd,int idx);
void skill_weaponrefine(struct map_session_data *sd,int idx); // [Celest]
Expand Down
1 change: 0 additions & 1 deletion src/map/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -2262,7 +2262,6 @@ int status_get_sc_def(struct block_list *src,struct block_list *bl, enum sc_type
int status_change_start(struct block_list* src, struct block_list* bl,enum sc_type type,int rate,int val1,int val2,int val3,int val4,int tick,unsigned char flag);
int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const char* file, int line);
#define status_change_end(bl,type,tid) status_change_end_(bl,type,tid,__FILE__,__LINE__)
int kaahi_heal_timer(int tid, unsigned int tick, int id, intptr_t data);
int status_change_timer(int tid, unsigned int tick, int id, intptr_t data);
int status_change_timer_sub(struct block_list* bl, va_list ap);
int status_change_clear(struct block_list* bl, int type);
Expand Down
5 changes: 2 additions & 3 deletions src/map/unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ struct map_session_data;
#include "path.h" // struct walkpath_data
#include "skill.h" // struct skill_timerskill, struct skill_unit_group, struct skill_unit_group_tickset

extern const short dirx[8]; ///lookup to know where will move to x according dir
extern const short diry[8]; ///lookup to know where will move to y according dir
extern const short dirx[DIR_MAX]; ///lookup to know where will move to x according dir
extern const short diry[DIR_MAX]; ///lookup to know where will move to y according dir

struct unit_data {
struct block_list *bl; ///link to owner object BL_PC|BL_MOB|BL_PET|BL_NPC|BL_HOM|BL_MER|BL_ELEM
Expand Down Expand Up @@ -135,7 +135,6 @@ int unit_set_target(struct unit_data* ud, int target_id);
// unit_data
void unit_dataset(struct block_list *bl);

int unit_fixdamage(struct block_list *src,struct block_list *target,unsigned int tick,int sdelay,int ddelay,int64 damage,int div,int type,int64 damage2);
// Remove unit
struct unit_data* unit_bl2ud(struct block_list *bl);
void unit_remove_map_pc(struct map_session_data *sd, clr_type clrtype);
Expand Down

0 comments on commit c88ca44

Please sign in to comment.