From cf3dec5af67f932ba9ac4b447cd309f7dc4b205f Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 29 Dec 2015 17:59:18 +0100 Subject: [PATCH] Fixed: Wrong check (if c is NULL, nothing is happening) --- .../entities_game_service/range_selector.cpp | 43 +++++++++---------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/code/ryzom/server/src/entities_game_service/range_selector.cpp b/code/ryzom/server/src/entities_game_service/range_selector.cpp index 158b406cf..169e83be5 100644 --- a/code/ryzom/server/src/entities_game_service/range_selector.cpp +++ b/code/ryzom/server/src/entities_game_service/range_selector.cpp @@ -33,30 +33,27 @@ void CRangeSelector::buildDisc( CEntityBase * actor, sint32 x, sint32 y,float ra for (uint32 i=0;i<_Entities.size();++i) BOMB_IF(_Entities[i]==&*it,"BUG: We just tried to insert the same entity into a disk entity list more than once!",continue); - if( c != 0 ) + CEntityBase * areaTarget = &(*it); + if( c != NULL) { - CEntityBase * areaTarget = &(*it); - if( c != 0) - { - // Do not add invisible entity for player - if( !R2_VISION::isEntityVisibleToPlayers(areaTarget->getWhoSeesMe())) - continue; - // Do not add invulnerable entities, they are GM and use a slot for nothing - if( areaTarget && areaTarget->invulnerableMode() ) - continue; - // Do not add the entity if a PVP rule excludes it from being selected - if( ! CPVPManager2::getInstance()->canApplyAreaEffect( c, areaTarget, offensiveAction, ignoreMainTarget ) ) - continue; - } - else - { - // Do not add invisible entity for creature - if( !R2_VISION::isEntityVisibleToMobs(areaTarget->getWhoSeesMe())) - continue; - // Do not add invulnerable entities, they are GM and use a slot for nothing - if( areaTarget && areaTarget->invulnerableMode() ) - continue; - } + // Do not add invisible entity for player + if( !R2_VISION::isEntityVisibleToPlayers(areaTarget->getWhoSeesMe())) + continue; + // Do not add invulnerable entities, they are GM and use a slot for nothing + if( areaTarget && areaTarget->invulnerableMode() ) + continue; + // Do not add the entity if a PVP rule excludes it from being selected + if( ! CPVPManager2::getInstance()->canApplyAreaEffect( c, areaTarget, offensiveAction, ignoreMainTarget ) ) + continue; + } + else + { + // Do not add invisible entity for creature + if( !R2_VISION::isEntityVisibleToMobs(areaTarget->getWhoSeesMe())) + continue; + // Do not add invulnerable entities, they are GM and use a slot for nothing + if( areaTarget && areaTarget->invulnerableMode() ) + continue; } _Entities.push_back(&*it);