From 747e0eae09c7af9ce7d4acb5af9f059d9d2495a9 Mon Sep 17 00:00:00 2001 From: haranp Date: Sat, 20 Sep 2008 23:23:41 +0000 Subject: Remove some unnecessary casts. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6958 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/debug.cc | 4 ++-- crawl-ref/source/monstuff.cc | 9 ++++----- crawl-ref/source/spl-cast.cc | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc index 710453c872..b82b2ad42e 100644 --- a/crawl-ref/source/debug.cc +++ b/crawl-ref/source/debug.cc @@ -4271,9 +4271,9 @@ void debug_miscast( int target_index ) actor* target; if (target_index == NON_MONSTER) - target = dynamic_cast(&you); + target = &you; else - target = dynamic_cast(&menv[target_index]); + target = &menv[target_index]; if (!target->alive()) { diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 07b1040006..3beb84676d 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -733,13 +733,13 @@ static void _mummy_curse(monsters* monster, killer_type killer, int index) actor* target; if (index == NON_MONSTER) - target = dynamic_cast(&you); + target = &you; else { // Mummies committing suicide don't cause a death curse. - if (index == (int) monster_index(monster)) + if (index == static_cast(monster_index(monster))) return; - target = dynamic_cast(&menv[index]); + target = &menv[index]; } // Mummy was killed by a giant spore or ball lightning? @@ -6952,9 +6952,8 @@ static bool _monster_move(monsters *monster) if (target_grid == DNGN_DEEP_WATER) deep_water_available = true; - const monsters* mons = dynamic_cast(monster); good_move[count_x][count_y] = - _mon_can_move_to_pos(mons, coord_def(count_x-1, count_y-1)); + _mon_can_move_to_pos(monster, coord_def(count_x-1, count_y-1)); } // Now we know where we _can_ move. diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 86320e69e3..8dde8f6add 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -2252,13 +2252,13 @@ void MiscastEffect::init() { kc = KC_YOU; kt = KILL_YOU_MISSILE; - act_source = dynamic_cast(&you); + act_source = &you; source_known = true; } else if (kill_source >= 0 && kill_source < NON_MONSTER) { mon_source = &menv[kill_source]; - act_source = dynamic_cast(mon_source); + act_source = mon_source; ASSERT(mon_source->type != -1); if (death_curse && target->atype() == ACT_MONSTER -- cgit v1.2.3-54-g00ecf