diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-10-12 18:41:40 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-10-12 18:41:40 -0700 |
commit | edd67db458188a76934b963e6a40f7b681f86b3d (patch) | |
tree | c8dec729b3f539ba027b1b3559598dbad0a70546 /src/map/pc.cpp | |
parent | 524df2190b855c4096449a1aaa7b92a15875f7a7 (diff) | |
download | tmwa-edd67db458188a76934b963e6a40f7b681f86b3d.tar.gz tmwa-edd67db458188a76934b963e6a40f7b681f86b3d.tar.bz2 tmwa-edd67db458188a76934b963e6a40f7b681f86b3d.tar.xz tmwa-edd67db458188a76934b963e6a40f7b681f86b3d.zip |
Disallow unchecked being casts
Despite the fact that that's what the code always did,
it was sometimes wrong.
Diffstat (limited to 'src/map/pc.cpp')
-rw-r--r-- | src/map/pc.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/map/pc.cpp b/src/map/pc.cpp index cf953aa..8750910 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -362,14 +362,14 @@ void pc_counttargeted_sub(dumb_ptr<block_list> bl, return; if (bl->bl_type == BL::PC) { - dumb_ptr<map_session_data> sd = bl->as_player(); + dumb_ptr<map_session_data> sd = bl->is_player(); if (sd->attacktarget == id && sd->attacktimer && sd->attacktarget_lv >= target_lv) (*c)++; } else if (bl->bl_type == BL::MOB) { - dumb_ptr<mob_data> md = bl->as_mob(); + dumb_ptr<mob_data> md = bl->is_mob(); if (md->target_id == id && md->timer && md->state.state == MS::ATTACK && md->target_lv >= target_lv) @@ -2775,7 +2775,7 @@ void pc_attack_timer(TimerData *, tick_t tick, int id) if (bl == NULL || bl->bl_prev == NULL) return; - if (bl->bl_type == BL::PC && pc_isdead(bl->as_player())) + if (bl->bl_type == BL::PC && pc_isdead(bl->is_player())) return; // 同じmapでないなら攻撃しない @@ -3427,7 +3427,7 @@ int pc_damage(dumb_ptr<block_list> src, dumb_ptr<map_session_data> sd, if (src->bl_type == BL::PC) { MAP_LOG_PC(sd, "INJURED-BY PC%d FOR %d", - src->as_player()->status.char_id, + src->is_player()->status.char_id, damage); } else @@ -3550,7 +3550,7 @@ int pc_damage(dumb_ptr<block_list> src, dumb_ptr<map_session_data> sd, { sd->pvp_point -= 5; if (src && src->bl_type == BL::PC) - src->as_player()->pvp_point++; + src->is_player()->pvp_point++; pc_setdead(sd); } // 強制送還 @@ -4747,7 +4747,7 @@ void pc_calc_pvprank_sub(dumb_ptr<block_list> bl, dumb_ptr<map_session_data> sd2 dumb_ptr<map_session_data> sd1; nullpo_retv(bl); - sd1 = bl->as_player(); + sd1 = bl->is_player(); nullpo_retv(sd2); if (sd1->pvp_point > sd2->pvp_point) |