diff options
author | hemagx <hemagx2@gmail.com> | 2015-12-26 11:17:14 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-01-06 15:09:56 +0100 |
commit | 1f71f41ee0fdf23680b40ba3d5bd63629e87c3e2 (patch) | |
tree | cb549e2f60e2aa6ed8db7751d862162e9ef4678a /src | |
parent | 829ebdd1527a7a4a585056463f8871d926698e2d (diff) | |
download | hercules-1f71f41ee0fdf23680b40ba3d5bd63629e87c3e2.tar.gz hercules-1f71f41ee0fdf23680b40ba3d5bd63629e87c3e2.tar.bz2 hercules-1f71f41ee0fdf23680b40ba3d5bd63629e87c3e2.tar.xz hercules-1f71f41ee0fdf23680b40ba3d5bd63629e87c3e2.zip |
Change all TBL_ELEM to struct elemental_data as per style guidelines
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/map/battle.c | 4 | ||||
-rw-r--r-- | src/map/clif.c | 2 | ||||
-rw-r--r-- | src/map/mob.c | 4 | ||||
-rw-r--r-- | src/map/status.c | 48 | ||||
-rw-r--r-- | src/map/unit.c | 2 |
5 files changed, 30 insertions, 30 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 59369f6a9..d6328c951 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -6405,8 +6405,8 @@ struct block_list* battle_get_master(struct block_list *src) { src = (struct block_list *)((struct mercenary_data *)src)->master; break; case BL_ELEM: - if (((TBL_ELEM*)src)->master) - src = (struct block_list*)((TBL_ELEM*)src)->master; + if (((struct elemental_data *)src)->master != NULL) + src = (struct block_list *)((struct elemental_data *)src)->master; break; case BL_SKILL: if (((struct skill_unit *)src)->group != NULL && ((struct skill_unit *)src)->group->src_id != 0) diff --git a/src/map/clif.c b/src/map/clif.c index 1ca323136..a2fbca41e 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -8458,7 +8458,7 @@ void clif_charnameack (int fd, struct block_list *bl) #endif return; case BL_ELEM: - memcpy(WBUFP(buf,6), ((TBL_ELEM*)bl)->db->name, NAME_LENGTH); + memcpy(WBUFP(buf,6), ((struct elemental_data *)bl)->db->name, NAME_LENGTH); break; default: ShowError("clif_charnameack: bad type %d(%d)\n", bl->type, bl->id); diff --git a/src/map/mob.c b/src/map/mob.c index f74f4e85f..e4eb00431 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2001,7 +2001,7 @@ void mob_log_damage(struct mob_data *md, struct block_list *src, int damage) } case BL_ELEM: { - struct elemental_data *ele = (TBL_ELEM*)src; + struct elemental_data *ele = (struct elemental_data *)src; if( ele->master ) char_id = ele->master->status.char_id; if( damage ) @@ -2585,7 +2585,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) { case BL_PET: sd = ((struct pet_data *)src)->msd; break; case BL_HOM: sd = ((struct homun_data *)src)->master; break; case BL_MER: sd = ((struct mercenary_data *)src)->master; break; - case BL_ELEM: sd = ((TBL_ELEM*)src)->master; break; + case BL_ELEM: sd = ((struct elemental_data *)src)->master; break; } } diff --git a/src/map/status.c b/src/map/status.c index c98231712..5ec4e64d0 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -1420,7 +1420,7 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp, 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((struct mercenary_data *)target, hp, sp); break; - case BL_ELEM: elemental->heal((TBL_ELEM*)target,hp,sp); break; + case BL_ELEM: elemental->heal((struct elemental_data *)target, hp, sp); break; } if (src != NULL && target->type == BL_PC && ((struct map_session_data *)target)->disguise > 0) { @@ -1446,7 +1446,7 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp, 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((struct mercenary_data *)target); break; - case BL_ELEM: flag = elemental->dead((TBL_ELEM*)target); break; + case BL_ELEM: flag = elemental->dead((struct elemental_data *)target); break; default: //Unhandled case, do nothing to object. flag = 0; break; @@ -1586,7 +1586,7 @@ int status_heal(struct block_list *bl,int64 in_hp,int64 in_sp, int flag) { 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((struct mercenary_data *)bl,hp,sp); break; - case BL_ELEM: elemental->heal((TBL_ELEM*)bl,hp,sp); break; + case BL_ELEM: elemental->heal((struct elemental_data *)bl,hp,sp); break; } return (int)(hp+sp); @@ -4102,7 +4102,7 @@ void status_calc_bl_(struct block_list *bl, enum scb_flag flag, enum e_status_ca if( bst.sp != st->sp ) clif->mercenary_updatestatus(md->master, SP_SP); } else if( bl->type == BL_ELEM ) { - TBL_ELEM* ed = BL_CAST(BL_ELEM, bl); + struct elemental_data *ed = BL_CAST(BL_ELEM, bl); if( bst.max_hp != st->max_hp ) clif->elemental_updatestatus(ed->master, SP_MAXHP); if( bst.max_sp != st->max_sp ) @@ -6229,7 +6229,7 @@ int status_get_class(struct block_list *bl) { case BL_HOM: return ((struct homun_data *)bl)->homunculus.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_; + case BL_ELEM: return ((struct elemental_data *)bl)->elemental.class_; } return 0; } @@ -6247,7 +6247,7 @@ int status_get_lv(struct block_list *bl) { case BL_PET: return ((struct pet_data *)bl)->pet.level; case BL_HOM: return ((struct homun_data *)bl)->homunculus.level; case BL_MER: return ((struct mercenary_data *)bl)->db->lv; - case BL_ELEM: return ((TBL_ELEM*)bl)->db->lv; + case BL_ELEM: return ((struct elemental_data *)bl)->db->lv; case BL_NPC: return ((TBL_NPC*)bl)->level; } return 1; @@ -6260,7 +6260,7 @@ struct regen_data *status_get_regen_data(struct block_list *bl) case BL_PC: return &((struct map_session_data *)bl)->regen; case BL_HOM: return &((struct homun_data *)bl)->regen; case BL_MER: return &((struct mercenary_data *)bl)->regen; - case BL_ELEM: return &((TBL_ELEM*)bl)->regen; + case BL_ELEM: return &((struct elemental_data *)bl)->regen; default: return NULL; } @@ -6276,7 +6276,7 @@ struct status_data *status_get_status_data(struct block_list *bl) case BL_PET: return &((struct pet_data *)bl)->status; case BL_HOM: return &((struct homun_data *)bl)->battle_status; case BL_MER: return &((struct mercenary_data *)bl)->battle_status; - case BL_ELEM: return &((TBL_ELEM*)bl)->battle_status; + case BL_ELEM: return &((struct elemental_data *)bl)->battle_status; case BL_NPC: return ((mob->db_checkid(((TBL_NPC*)bl)->class_) == 0) ? &((TBL_NPC*)bl)->status : &status->dummy); default: return &status->dummy; @@ -6292,7 +6292,7 @@ struct status_data *status_get_base_status(struct block_list *bl) case BL_PET: return &((struct pet_data *)bl)->db->status; case BL_HOM: return &((struct homun_data *)bl)->base_status; case BL_MER: return &((struct mercenary_data *)bl)->base_status; - case BL_ELEM: return &((TBL_ELEM*)bl)->base_status; + case BL_ELEM: return &((struct elemental_data *)bl)->base_status; case BL_NPC: return ((mob->db_checkid(((TBL_NPC*)bl)->class_) == 0) ? &((TBL_NPC*)bl)->status : NULL); default: return NULL; @@ -6348,8 +6348,8 @@ int status_get_party_id(struct block_list *bl) { return ((struct skill_unit *)bl)->group->party_id; break; case BL_ELEM: - if (((TBL_ELEM*)bl)->master) - return ((TBL_ELEM*)bl)->master->status.party_id; + if (((struct elemental_data *)bl)->master != NULL) + return ((struct elemental_data *)bl)->master->status.party_id; break; } return 0; @@ -6393,8 +6393,8 @@ int status_get_guild_id(struct block_list *bl) { return ((struct skill_unit *)bl)->group->guild_id; break; case BL_ELEM: - if (((TBL_ELEM*)bl)->master) - return ((TBL_ELEM*)bl)->master->status.guild_id; + if (((struct elemental_data *)bl)->master != NULL) + return ((struct elemental_data *)bl)->master->status.guild_id; break; } return 0; @@ -6435,8 +6435,8 @@ int status_get_emblem_id(struct block_list *bl) { } break; case BL_ELEM: - if (((TBL_ELEM*)bl)->master) - return ((TBL_ELEM*)bl)->master->guild_emblem_id; + if (((struct elemental_data *)bl)->master) + return ((struct elemental_data *)bl)->master->guild_emblem_id; break; } return 0; @@ -6486,7 +6486,7 @@ struct view_data* status_get_viewdata(struct block_list *bl) case BL_NPC: return ((TBL_NPC*)bl)->vd; case BL_HOM: return ((struct homun_data *)bl)->vd; case BL_MER: return ((struct mercenary_data *)bl)->vd; - case BL_ELEM: return ((TBL_ELEM*)bl)->vd; + case BL_ELEM: return ((struct elemental_data *)bl)->vd; } return NULL; } @@ -6629,13 +6629,13 @@ void status_set_viewdata(struct block_list *bl, int class_) } break; case BL_ELEM: - { - struct elemental_data *ed = (struct elemental_data*)bl; - if (vd) - ed->vd = vd; - else - ShowError("status_set_viewdata (ELEMENTAL): No view data for class %d\n", class_); - } + { + struct elemental_data *ed = (struct elemental_data*)bl; + if (vd != NULL) + ed->vd = vd; + else + ShowError("status_set_viewdata (ELEMENTAL): No view data for class %d\n", class_); + } break; } } @@ -6649,7 +6649,7 @@ struct status_change *status_get_sc(struct block_list *bl) { case BL_NPC: return NULL; case BL_HOM: return &((struct homun_data *)bl)->sc; case BL_MER: return &((struct mercenary_data *)bl)->sc; - case BL_ELEM: return &((TBL_ELEM*)bl)->sc; + case BL_ELEM: return &((struct elemental_data *)bl)->sc; } } return NULL; diff --git a/src/map/unit.c b/src/map/unit.c index fab001adb..7cc510547 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -2817,7 +2817,7 @@ int unit_free(struct block_list *bl, clr_type clrtype) { break; } case BL_ELEM: { - struct elemental_data *ed = (TBL_ELEM*)bl; + struct elemental_data *ed = (struct elemental_data *)bl; struct map_session_data *sd = ed->master; if( elemental->get_lifetime(ed) > 0 ) elemental->save(ed); |