summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c8
-rw-r--r--src/map/battleground.c4
-rw-r--r--src/map/clif.c4
-rw-r--r--src/map/mob.c4
-rw-r--r--src/map/pc.c2
-rw-r--r--src/map/script.c4
-rw-r--r--src/map/skill.c8
-rw-r--r--src/map/status.c69
-rw-r--r--src/map/unit.c2
9 files changed, 52 insertions, 53 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index af2ef018a..9e3c05641 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -2870,7 +2870,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
// Autoguard will be disabled later on
struct block_list *d_bl = map->id2bl(sce_d->val1);
if (d_bl && check_distance_bl(bl, d_bl, sce_d->val3)
- && ((d_bl->type == BL_MER && ((TBL_MER*)d_bl)->master && ((TBL_MER*)d_bl)->master->bl.id == bl->id)
+ && ((d_bl->type == BL_MER && ((struct mercenary_data *)d_bl)->master && ((struct mercenary_data *)d_bl)->master->bl.id == bl->id)
|| (d_bl->type == BL_PC && ((struct map_session_data *)d_bl)->devotion[sce_d->val2] == bl->id))
) {
// if player is target of devotion, show guard effect on the devotion caster rather than the target
@@ -6206,7 +6206,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
struct block_list *d_bl = map->id2bl(sce->val1);
if (d_bl != NULL
- && ((d_bl->type == BL_MER && ((TBL_MER *)d_bl)->master && ((TBL_MER *)d_bl)->master->bl.id == target->id)
+ && ((d_bl->type == BL_MER && ((struct mercenary_data *)d_bl)->master && ((struct mercenary_data *)d_bl)->master->bl.id == target->id)
|| (d_bl->type == BL_PC && ((struct map_session_data *)d_bl)->devotion[sce->val2] == target->id)
)
&& check_distance_bl(target, d_bl, sce->val3)
@@ -6401,8 +6401,8 @@ struct block_list* battle_get_master(struct block_list *src) {
src = (struct block_list *)((struct homun_data *)src)->master;
break;
case BL_MER:
- if (((TBL_MER*)src)->master)
- src = (struct block_list*)((TBL_MER*)src)->master;
+ if (((struct mercenary_data *)src)->master != NULL)
+ src = (struct block_list *)((struct mercenary_data *)src)->master;
break;
case BL_ELEM:
if (((TBL_ELEM*)src)->master)
diff --git a/src/map/battleground.c b/src/map/battleground.c
index 7ac18daf8..e740a3370 100644
--- a/src/map/battleground.c
+++ b/src/map/battleground.c
@@ -238,8 +238,8 @@ int bg_team_get_id(struct block_list *bl) {
return ((struct homun_data*)bl)->master->bg_id;
break;
case BL_MER:
- if( ((TBL_MER*)bl)->master )
- return ((TBL_MER*)bl)->master->bg_id;
+ if (((struct mercenary_data *)bl)->master != NULL)
+ return ((struct mercenary_data *)bl)->master->bg_id;
break;
case BL_SKILL:
return ((TBL_SKILL*)bl)->group->bg_id;
diff --git a/src/map/clif.c b/src/map/clif.c
index 5e078b5c9..af5af4e8c 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -4197,7 +4197,7 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl) {
}
break;
case BL_MER: // Devotion Effects
- if( ((TBL_MER*)bl)->devotion_flag )
+ if (((struct mercenary_data *)bl)->devotion_flag)
clif->devotion(bl, sd);
break;
case BL_NPC:
@@ -8412,7 +8412,7 @@ void clif_charnameack (int fd, struct block_list *bl)
memcpy(WBUFP(buf,6), ((struct homun_data *)bl)->homunculus.name, NAME_LENGTH);
break;
case BL_MER:
- memcpy(WBUFP(buf,6), ((TBL_MER*)bl)->db->name, NAME_LENGTH);
+ memcpy(WBUFP(buf,6), ((struct mercenary_data *)bl)->db->name, NAME_LENGTH);
break;
case BL_PET:
memcpy(WBUFP(buf,6), ((TBL_PET*)bl)->pet.name, NAME_LENGTH);
diff --git a/src/map/mob.c b/src/map/mob.c
index 2c7f3a585..311e1049d 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -1963,7 +1963,7 @@ void mob_log_damage(struct mob_data *md, struct block_list *src, int damage)
}
case BL_MER:
{
- struct mercenary_data *mer = (TBL_MER*)src;
+ struct mercenary_data *mer = (struct mercenary_data *)src;
if( mer->master )
char_id = mer->master->status.char_id;
if( damage )
@@ -2584,7 +2584,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
switch( src->type ) {
case BL_PET: sd = ((TBL_PET*)src)->msd; break;
case BL_HOM: sd = ((struct homun_data *)src)->master; break;
- case BL_MER: sd = ((TBL_MER*)src)->master; break;
+ case BL_MER: sd = ((struct mercenary_data *)src)->master; break;
case BL_ELEM: sd = ((TBL_ELEM*)src)->master; break;
}
}
diff --git a/src/map/pc.c b/src/map/pc.c
index a630f88c2..8c794922b 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -7629,7 +7629,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
src = &((struct homun_data *)src)->master->bl;
break;
case BL_MER:
- src = &((TBL_MER*)src)->master->bl;
+ src = &((struct mercenary_data *)src)->master->bl;
break;
}
}
diff --git a/src/map/script.c b/src/map/script.c
index 65dcba2f9..51f18dfb6 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -16385,10 +16385,10 @@ BUILDIN(rid2name) {
switch(bl->type) {
case BL_MOB: script_pushstrcopy(st, ((struct mob_data *)bl)->name); break;
case BL_PC: script_pushstrcopy(st, ((struct map_session_data *)bl)->status.name); break;
- case BL_NPC: script_pushstrcopy(st,((TBL_NPC*)bl)->exname); break;
+ case BL_NPC: script_pushstrcopy(st, ((struct npc_data *)bl)->exname); break;
case BL_PET: script_pushstrcopy(st,((TBL_PET*)bl)->pet.name); break;
case BL_HOM: script_pushstrcopy(st, ((struct homun_data *)bl)->homunculus.name); break;
- case BL_MER: script_pushstrcopy(st,((TBL_MER*)bl)->db->name); break;
+ case BL_MER: script_pushstrcopy(st, ((struct mercenary_data *)bl)->db->name); break;
default:
ShowError("buildin_rid2name: BL type unknown.\n");
script_pushconststr(st,"");
diff --git a/src/map/skill.c b/src/map/skill.c
index cd46aaa6a..a7fea4a58 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -2771,7 +2771,7 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr
struct block_list *d_bl = map->id2bl(sce->val1);
if (d_bl != NULL
- && ((d_bl->type == BL_MER && ((TBL_MER *)d_bl)->master && ((TBL_MER *)d_bl)->master->bl.id == bl->id)
+ && ((d_bl->type == BL_MER && ((struct mercenary_data *)d_bl)->master && ((struct mercenary_data *)d_bl)->master->bl.id == bl->id)
|| (d_bl->type == BL_PC && ((struct map_session_data *)d_bl)->devotion[sce->val2] == bl->id)
)
&& check_distance_bl(bl, d_bl, sce->val3)
@@ -3093,7 +3093,7 @@ int skill_check_condition_mercenary(struct block_list *bl, int skill_id, int lv,
switch( bl->type ) {
case BL_HOM: sd = ((struct homun_data *)bl)->master; break;
- case BL_MER: sd = ((TBL_MER*)bl)->master; break;
+ case BL_MER: sd = ((struct mercenary_data *)bl)->master; break;
}
st = status->get_status_data(bl);
@@ -5817,7 +5817,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
if( sd )
skill->blockpc_start(sd, skill_id, skill->get_time(skill_id, skill_lv));
else if( bl->type == BL_MER )
- skill->blockmerc_start((TBL_MER*)bl, skill_id, skill->get_time(skill_id, skill_lv));
+ skill->blockmerc_start((struct mercenary_data *)bl, skill_id, skill->get_time(skill_id, skill_lv));
break;
case TK_JUMPKICK:
@@ -18052,7 +18052,7 @@ int skill_blockhomun_start(struct homun_data *hd, uint16 skill_id, int tick) { /
}
int skill_blockmerc_end(int tid, int64 tick, int id, intptr_t data) {// [orn]
- struct mercenary_data *md = (TBL_MER*)map->id2bl(id);
+ struct mercenary_data *md = (struct mercenary_data *)map->id2bl(id);
if( data <= 0 || data >= MAX_SKILL )
return 0;
if( md ) md->blockskill[data] = 0;
diff --git a/src/map/status.c b/src/map/status.c
index 777ff5fea..1af57b94f 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1352,7 +1352,7 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp,
struct block_list *d_bl = map->id2bl(sce->val1);
if (d_bl != NULL
- && ((d_bl->type == BL_MER && ((TBL_MER *)d_bl)->master && ((TBL_MER *)d_bl)->master->bl.id == target->id)
+ && ((d_bl->type == BL_MER && ((struct mercenary_data *)d_bl)->master && ((struct mercenary_data *)d_bl)->master->bl.id == target->id)
|| (d_bl->type == BL_PC && ((struct map_session_data *)d_bl)->devotion[sce->val2] == target->id)
)
&& check_distance_bl(target, d_bl, sce->val3)
@@ -1419,7 +1419,7 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp,
case BL_PC: pc->damage((struct map_session_data *)target, src, hp, sp); break;
case BL_MOB: mob->damage((struct mob_data *)target, src, hp); break;
case BL_HOM: homun->damaged((struct homun_data *)target); break;
- case BL_MER: mercenary->heal((TBL_MER*)target,hp,sp); break;
+ case BL_MER: mercenary->heal((struct mercenary_data *)target, hp, sp); break;
case BL_ELEM: elemental->heal((TBL_ELEM*)target,hp,sp); break;
}
@@ -1445,7 +1445,7 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp,
case BL_PC: flag = pc->dead((struct map_session_data *)target, src); break;
case BL_MOB: flag = mob->dead((struct mob_data *)target, src, (flag&4) ? 3 : 0); break;
case BL_HOM: flag = homun->dead((struct homun_data *)target); break;
- case BL_MER: flag = mercenary->dead((TBL_MER*)target); break;
+ case BL_MER: flag = mercenary->dead((struct mercenary_data *)target); break;
case BL_ELEM: flag = elemental->dead((TBL_ELEM*)target); break;
default: //Unhandled case, do nothing to object.
flag = 0;
@@ -1585,7 +1585,7 @@ int status_heal(struct block_list *bl,int64 in_hp,int64 in_sp, int flag) {
case BL_PC: pc->heal((struct map_session_data *)bl,hp,sp,(flag&2) ? 1 : 0); break;
case BL_MOB: mob->heal((struct mob_data *)bl,hp); break;
case BL_HOM: homun->healed((struct homun_data *)bl); break;
- case BL_MER: mercenary->heal((TBL_MER*)bl,hp,sp); break;
+ case BL_MER: mercenary->heal((struct mercenary_data *)bl,hp,sp); break;
case BL_ELEM: elemental->heal((TBL_ELEM*)bl,hp,sp); break;
}
@@ -4076,7 +4076,7 @@ void status_calc_bl_(struct block_list *bl, enum scb_flag flag, enum e_status_ca
if (hd->master != NULL && memcmp(&bst, st, sizeof(struct status_data)) != 0)
clif->hominfo(hd->master,hd,0);
} else if( bl->type == BL_MER ) {
- TBL_MER* md = BL_CAST(BL_MER, bl);
+ struct mercenary_data *md = BL_CAST(BL_MER, bl);
if( bst.rhw.atk != st->rhw.atk || bst.rhw.atk2 != st->rhw.atk2 )
clif->mercenary_updatestatus(md->master, SP_ATK1);
if( bst.matk_max != st->matk_max )
@@ -6227,7 +6227,7 @@ int status_get_class(struct block_list *bl) {
case BL_MOB: return ((struct mob_data *)bl)->vd->class_; //Class used on all code should be the view class of the mob.
case BL_PET: return ((TBL_PET*)bl)->pet.class_;
case BL_HOM: return ((struct homun_data *)bl)->homunculus.class_;
- case BL_MER: return ((TBL_MER*)bl)->mercenary.class_;
+ case BL_MER: return ((struct mercenary_data *)bl)->mercenary.class_;
case BL_NPC: return ((TBL_NPC*)bl)->class_;
case BL_ELEM: return ((TBL_ELEM*)bl)->elemental.class_;
}
@@ -6246,7 +6246,7 @@ int status_get_lv(struct block_list *bl) {
case BL_MOB: return ((struct mob_data *)bl)->level;
case BL_PET: return ((TBL_PET*)bl)->pet.level;
case BL_HOM: return ((struct homun_data *)bl)->homunculus.level;
- case BL_MER: return ((TBL_MER*)bl)->db->lv;
+ case BL_MER: return ((struct mercenary_data *)bl)->db->lv;
case BL_ELEM: return ((TBL_ELEM*)bl)->db->lv;
case BL_NPC: return ((TBL_NPC*)bl)->level;
}
@@ -6259,7 +6259,7 @@ struct regen_data *status_get_regen_data(struct block_list *bl)
switch (bl->type) {
case BL_PC: return &((struct map_session_data *)bl)->regen;
case BL_HOM: return &((struct homun_data *)bl)->regen;
- case BL_MER: return &((TBL_MER*)bl)->regen;
+ case BL_MER: return &((struct mercenary_data *)bl)->regen;
case BL_ELEM: return &((TBL_ELEM*)bl)->regen;
default:
return NULL;
@@ -6275,7 +6275,7 @@ struct status_data *status_get_status_data(struct block_list *bl)
case BL_MOB: return &((struct mob_data *)bl)->status;
case BL_PET: return &((TBL_PET*)bl)->status;
case BL_HOM: return &((struct homun_data *)bl)->battle_status;
- case BL_MER: return &((TBL_MER*)bl)->battle_status;
+ case BL_MER: return &((struct mercenary_data *)bl)->battle_status;
case BL_ELEM: return &((TBL_ELEM*)bl)->battle_status;
case BL_NPC: return ((mob->db_checkid(((TBL_NPC*)bl)->class_) == 0) ? &((TBL_NPC*)bl)->status : &status->dummy);
default:
@@ -6291,7 +6291,7 @@ struct status_data *status_get_base_status(struct block_list *bl)
case BL_MOB: return ((struct mob_data *)bl)->base_status ? ((struct mob_data *)bl)->base_status : &((struct mob_data *)bl)->db->status;
case BL_PET: return &((TBL_PET*)bl)->db->status;
case BL_HOM: return &((struct homun_data *)bl)->base_status;
- case BL_MER: return &((TBL_MER*)bl)->base_status;
+ case BL_MER: return &((struct mercenary_data *)bl)->base_status;
case BL_ELEM: return &((TBL_ELEM*)bl)->base_status;
case BL_NPC: return ((mob->db_checkid(((TBL_NPC*)bl)->class_) == 0) ? &((TBL_NPC*)bl)->status : NULL);
default:
@@ -6340,8 +6340,8 @@ int status_get_party_id(struct block_list *bl) {
return ((struct homun_data *)bl)->master->status.party_id;
break;
case BL_MER:
- if (((TBL_MER*)bl)->master)
- return ((TBL_MER*)bl)->master->status.party_id;
+ if (((struct mercenary_data *)bl)->master != NULL)
+ return ((struct mercenary_data *)bl)->master->status.party_id;
break;
case BL_SKILL:
if (((TBL_SKILL*)bl)->group)
@@ -6381,8 +6381,8 @@ int status_get_guild_id(struct block_list *bl) {
return ((struct homun_data *)bl)->master->status.guild_id;
break;
case BL_MER:
- if (((TBL_MER*)bl)->master)
- return ((TBL_MER*)bl)->master->status.guild_id;
+ if (((struct mercenary_data *)bl)->master != NULL)
+ return ((struct mercenary_data *)bl)->master->status.guild_id;
break;
case BL_NPC:
if (((TBL_NPC*)bl)->subtype == SCRIPT)
@@ -6424,8 +6424,8 @@ int status_get_emblem_id(struct block_list *bl) {
return ((struct homun_data *)bl)->master->guild_emblem_id;
break;
case BL_MER:
- if (((TBL_MER*)bl)->master)
- return ((TBL_MER*)bl)->master->guild_emblem_id;
+ if (((struct mercenary_data *)bl)->master)
+ return ((struct mercenary_data *)bl)->master->guild_emblem_id;
break;
case BL_NPC:
if (((TBL_NPC*)bl)->subtype == SCRIPT && ((TBL_NPC*)bl)->u.scr.guild_id > 0) {
@@ -6485,7 +6485,7 @@ struct view_data* status_get_viewdata(struct block_list *bl)
case BL_PET: return &((TBL_PET*)bl)->vd;
case BL_NPC: return ((TBL_NPC*)bl)->vd;
case BL_HOM: return ((struct homun_data *)bl)->vd;
- case BL_MER: return ((TBL_MER*)bl)->vd;
+ case BL_MER: return ((struct mercenary_data *)bl)->vd;
case BL_ELEM: return ((TBL_ELEM*)bl)->vd;
}
return NULL;
@@ -6619,13 +6619,13 @@ void status_set_viewdata(struct block_list *bl, int class_)
}
break;
case BL_MER:
- {
- struct mercenary_data *md = (struct mercenary_data*)bl;
- if (vd)
- md->vd = vd;
- else
- ShowError("status_set_viewdata (MERCENARY): No view data for class %d\n", class_);
- }
+ {
+ struct mercenary_data *md = (struct mercenary_data *)bl;
+ if (vd != NULL)
+ md->vd = vd;
+ else
+ ShowError("status_set_viewdata (MERCENARY): No view data for class %d\n", class_);
+ }
break;
case BL_ELEM:
{
@@ -6647,7 +6647,7 @@ struct status_change *status_get_sc(struct block_list *bl) {
case BL_MOB: return &((struct mob_data *)bl)->sc;
case BL_NPC: return NULL;
case BL_HOM: return &((struct homun_data *)bl)->sc;
- case BL_MER: return &((TBL_MER*)bl)->sc;
+ case BL_MER: return &((struct mercenary_data *)bl)->sc;
case BL_ELEM: return &((TBL_ELEM*)bl)->sc;
}
}
@@ -7917,7 +7917,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
if (sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) != NULL)
status->change_start(bl, &tsd->bl, type, 10000, val1, val2, val3, val4, tick, SCFLAG_ALL);
}
- } else if (bl->type == BL_MER && ((TBL_MER*)bl)->devotion_flag && (tsd = ((TBL_MER*)bl)->master) != NULL) {
+ } else if (bl->type == BL_MER && ((struct mercenary_data *)bl)->devotion_flag && (tsd = ((struct mercenary_data *)bl)->master) != NULL) {
status->change_start(bl, &tsd->bl, type, 10000, val1, val2, val3, val4, tick, SCFLAG_ALL);
}
}
@@ -8017,7 +8017,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
if (sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) != NULL)
status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_ALL);
}
- } else if (bl->type == BL_MER && ((TBL_MER*)bl)->devotion_flag && (tsd = ((TBL_MER*)bl)->master) != NULL) {
+ } else if (bl->type == BL_MER && ((struct mercenary_data *)bl)->devotion_flag && (tsd = ((struct mercenary_data *)bl)->master) != NULL) {
status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_ALL);
}
}
@@ -8278,8 +8278,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
if (sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) != NULL)
status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_ALL);
}
- }
- else if (bl->type == BL_MER && ((TBL_MER*)bl)->devotion_flag && (tsd = ((TBL_MER*)bl)->master) != NULL) {
+ } else if (bl->type == BL_MER && ((struct mercenary_data *)bl)->devotion_flag && (tsd = ((struct mercenary_data *)bl)->master) != NULL) {
status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_ALL);
}
}
@@ -10228,10 +10227,10 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
if (sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) != NULL && tsd->sc.data[type])
status_change_end(&tsd->bl, type, INVALID_TIMER);
}
- } else if( bl->type == BL_MER && ((TBL_MER*)bl)->devotion_flag ) {
+ } else if (bl->type == BL_MER && ((struct mercenary_data *)bl)->devotion_flag) {
// Clear Status from Master
- tsd = ((TBL_MER*)bl)->master;
- if( tsd && tsd->sc.data[type] )
+ tsd = ((struct mercenary_data *)bl)->master;
+ if (tsd != NULL && tsd->sc.data[type] != NULL)
status_change_end(&tsd->bl, type, INVALID_TIMER);
}
}
@@ -10243,7 +10242,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
if( d_bl->type == BL_PC )
((struct map_session_data*)d_bl)->devotion[sce->val2] = 0;
else if( d_bl->type == BL_MER )
- ((TBL_MER*)d_bl)->devotion_flag = 0;
+ ((struct mercenary_data *)d_bl)->devotion_flag = 0;
clif->devotion(d_bl, NULL);
}
@@ -11922,8 +11921,8 @@ void status_get_matk_sub(struct block_list *bl, int flag, unsigned short *matk_m
}
break;
case BL_MER:
- *matk_min += 70 * ((TBL_MER*)bl)->battle_status.rhw.atk2 / 100;
- *matk_max += 130 * ((TBL_MER*)bl)->battle_status.rhw.atk2 / 100;
+ *matk_min += 70 * ((struct mercenary_data *)bl)->battle_status.rhw.atk2 / 100;
+ *matk_max += 130 * ((struct mercenary_data *)bl)->battle_status.rhw.atk2 / 100;
break;
case BL_MOB:
*matk_min += 70 * ((struct mob_data *)bl)->status.rhw.atk2 / 100;
diff --git a/src/map/unit.c b/src/map/unit.c
index fefa494fc..5d6c3b77a 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -2800,7 +2800,7 @@ int unit_free(struct block_list *bl, clr_type clrtype) {
}
case BL_MER:
{
- struct mercenary_data *md = (TBL_MER*)bl;
+ struct mercenary_data *md = (struct mercenary_data *)bl;
struct map_session_data *sd = md->master;
if( mercenary->get_lifetime(md) > 0 )
mercenary->save(md);