From 3be9cace41bcef4b7bf55bffea5d3596bd588e7e Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Thu, 25 Mar 2010 23:45:27 -0600 Subject: Replace most dynamic_casts with static_casts The remaining instances can't easily or safely be changed as the classes involved don't have type information like Being does. Reviewed-by: Freeyorp --- src/playerrelations.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/playerrelations.cpp') diff --git a/src/playerrelations.cpp b/src/playerrelations.cpp index 95463192..113ce224 100644 --- a/src/playerrelations.cpp +++ b/src/playerrelations.cpp @@ -221,10 +221,9 @@ bool PlayerRelationsManager::hasPermission(const std::string &name, // execute `ignore' strategy, if possible if (mIgnoreStrategy) { - Player *to_ignore = dynamic_cast(beingManager->findBeingByName(name, Being::PLAYER)); - - if (to_ignore) - mIgnoreStrategy->ignore(to_ignore, rejections); + Being *b = beingManager->findBeingByName(name, Being::PLAYER); + if (b->getType() == Being::PLAYER) + mIgnoreStrategy->ignore(static_cast(b), rejections); } } -- cgit v1.2.3-70-g09d2