Cleaned struct tokens for map_session_data and status_change (#7490)
Fixes #7492
This commit is contained in:
@@ -537,7 +537,7 @@ int mob_get_random_id(int type, enum e_random_monster_flags flag, int lv)
|
||||
bool mob_ksprotected (struct block_list *src, struct block_list *target)
|
||||
{
|
||||
struct block_list *s_bl, *t_bl;
|
||||
struct map_session_data
|
||||
map_session_data
|
||||
*sd, // Source
|
||||
*t_sd; // Mob Target
|
||||
struct mob_data *md;
|
||||
@@ -563,7 +563,7 @@ bool mob_ksprotected (struct block_list *src, struct block_list *target)
|
||||
|
||||
do {
|
||||
struct status_change_entry *sce;
|
||||
struct map_session_data *pl_sd; // Owner
|
||||
map_session_data *pl_sd; // Owner
|
||||
struct map_data *mapdata = map_getmapdata(md->bl.m);
|
||||
char output[128];
|
||||
|
||||
@@ -662,7 +662,7 @@ struct mob_data *mob_once_spawn_sub(struct block_list *bl, int16 m, int16 x, int
|
||||
/*==========================================
|
||||
* Spawn a single mob on the specified coordinates.
|
||||
*------------------------------------------*/
|
||||
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, enum mob_ai ai)
|
||||
int mob_once_spawn(map_session_data* sd, int16 m, int16 x, int16 y, const char* mobname, int mob_id, int amount, const char* event, unsigned int size, enum mob_ai ai)
|
||||
{
|
||||
struct mob_data* md = nullptr;
|
||||
int count, lv;
|
||||
@@ -714,7 +714,7 @@ int mob_once_spawn(struct map_session_data* sd, int16 m, int16 x, int16 y, const
|
||||
/*==========================================
|
||||
* Spawn mobs in the specified area.
|
||||
*------------------------------------------*/
|
||||
int mob_once_spawn_area(struct map_session_data* sd, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, const char* mobname, int mob_id, int amount, const char* event, unsigned int size, enum mob_ai ai)
|
||||
int mob_once_spawn_area(map_session_data* sd, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, const char* mobname, int mob_id, int amount, const char* event, unsigned int size, enum mob_ai ai)
|
||||
{
|
||||
int i, max, id = 0;
|
||||
int lx = -1, ly = -1;
|
||||
@@ -1994,7 +1994,7 @@ static int mob_ai_sub_hard_timer(struct block_list *bl,va_list ap)
|
||||
/*==========================================
|
||||
* Serious processing for mob in PC field of view (foreachclient)
|
||||
*------------------------------------------*/
|
||||
static int mob_ai_sub_foreachclient(struct map_session_data *sd,va_list ap)
|
||||
static int mob_ai_sub_foreachclient(map_session_data *sd,va_list ap)
|
||||
{
|
||||
t_tick tick=va_arg(ap,t_tick);
|
||||
map_foreachinallrange(mob_ai_sub_hard_timer,&sd->bl, AREA_SIZE+ACTIVE_AI_RANGE, BL_MOB, sd->status.char_id, tick);
|
||||
@@ -2296,7 +2296,7 @@ void mob_log_damage(struct mob_data *md, struct block_list *src, int damage)
|
||||
{
|
||||
case BL_PC:
|
||||
{
|
||||
struct map_session_data *sd = (TBL_PC*)src;
|
||||
map_session_data *sd = (TBL_PC*)src;
|
||||
char_id = sd->status.char_id;
|
||||
if( damage )
|
||||
md->attacked_id = src->id;
|
||||
@@ -2338,7 +2338,7 @@ void mob_log_damage(struct mob_data *md, struct block_list *src, int damage)
|
||||
struct mob_data* md2 = (TBL_MOB*)src;
|
||||
if( md2->special_state.ai && md2->master_id )
|
||||
{
|
||||
struct map_session_data* msd = map_id2sd(md2->master_id);
|
||||
map_session_data* msd = map_id2sd(md2->master_id);
|
||||
if( msd )
|
||||
char_id = msd->status.char_id;
|
||||
}
|
||||
@@ -2439,7 +2439,7 @@ void mob_damage(struct mob_data *md, struct block_list *src, int damage)
|
||||
clif_summon_hp_bar(*md);
|
||||
}
|
||||
for(i = 0; i < DAMAGELOG_SIZE; i++){ // must show hp bar to all char who already hit the mob.
|
||||
struct map_session_data *sd = map_charid2sd(md->dmglog[i].id);
|
||||
map_session_data *sd = map_charid2sd(md->dmglog[i].id);
|
||||
if( sd && check_distance_bl(&md->bl, &sd->bl, AREA_SIZE) ) // check if in range
|
||||
clif_monster_hp_bar(md, sd->fd);
|
||||
}
|
||||
@@ -2474,7 +2474,7 @@ int mob_getdroprate(struct block_list *src, std::shared_ptr<s_mob_db> mob, int b
|
||||
drop_rate += (int)(0.5 + drop_rate * status_get_luk(src) * battle_config.drops_by_luk2 / 10000.);
|
||||
|
||||
if (src->type == BL_PC) { // Player specific drop rate adjustments
|
||||
struct map_session_data *sd = (struct map_session_data*)src;
|
||||
map_session_data *sd = (map_session_data*)src;
|
||||
int drop_rate_bonus = 100;
|
||||
|
||||
// In PK mode players get an additional drop chance bonus of 25% if there is a 20 level difference
|
||||
@@ -2532,8 +2532,8 @@ int mob_getdroprate(struct block_list *src, std::shared_ptr<s_mob_db> mob, int b
|
||||
int mob_dead(struct mob_data *md, struct block_list *src, int type)
|
||||
{
|
||||
struct status_data *status;
|
||||
struct map_session_data *sd = NULL, *tmpsd[DAMAGELOG_SIZE];
|
||||
struct map_session_data *mvp_sd = NULL, *second_sd = NULL, *third_sd = NULL;
|
||||
map_session_data *sd = NULL, *tmpsd[DAMAGELOG_SIZE];
|
||||
map_session_data *mvp_sd = NULL, *second_sd = NULL, *third_sd = NULL;
|
||||
|
||||
struct {
|
||||
struct party_data *p;
|
||||
@@ -2550,7 +2550,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
|
||||
status = &md->status;
|
||||
|
||||
if( src && src->type == BL_PC ) {
|
||||
sd = (struct map_session_data *)src;
|
||||
sd = (map_session_data *)src;
|
||||
mvp_sd = sd;
|
||||
}
|
||||
|
||||
@@ -2574,7 +2574,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
|
||||
// filter out entries not eligible for exp distribution
|
||||
memset(tmpsd,0,sizeof(tmpsd));
|
||||
for(i = 0, count = 0, mvp_damage = 0; i < DAMAGELOG_SIZE && md->dmglog[i].id; i++) {
|
||||
struct map_session_data* tsd = NULL;
|
||||
map_session_data* tsd = NULL;
|
||||
if (md->dmglog[i].flag == MDLF_SELF) {
|
||||
//Self damage counts as exp tap
|
||||
count++;
|
||||
@@ -3405,7 +3405,7 @@ void mob_heal(struct mob_data *md,unsigned int heal)
|
||||
}
|
||||
for(i = 0; i < DAMAGELOG_SIZE; i++)// must show hp bar to all char who already hit the mob.
|
||||
if( md->dmglog[i].id ) {
|
||||
struct map_session_data *sd = map_charid2sd(md->dmglog[i].id);
|
||||
map_session_data *sd = map_charid2sd(md->dmglog[i].id);
|
||||
if( sd && check_distance_bl(&md->bl, &sd->bl, AREA_SIZE) ) // check if in range
|
||||
clif_monster_hp_bar(md, sd->fd);
|
||||
}
|
||||
@@ -3994,7 +3994,7 @@ static bool mob_clone_disabled_skills(uint16 skill_id) {
|
||||
//If mode is not passed, a default aggressive mode is used.
|
||||
//If master_id is passed, clone is attached to him.
|
||||
//Returns: ID of newly crafted copy.
|
||||
int mob_clone_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, const char *event, int master_id, enum e_mode mode, int flag, unsigned int duration)
|
||||
int mob_clone_spawn(map_session_data *sd, int16 m, int16 x, int16 y, const char *event, int master_id, enum e_mode mode, int flag, unsigned int duration)
|
||||
{
|
||||
int mob_id;
|
||||
int inf, fd;
|
||||
|
||||
Reference in New Issue
Block a user