Fixed: Wrong check (if c is NULL, nothing is happening)

This commit is contained in:
kervala 2015-12-29 17:59:18 +01:00
parent 64145a8a70
commit cf3dec5af6

View file

@ -33,30 +33,27 @@ void CRangeSelector::buildDisc( CEntityBase * actor, sint32 x, sint32 y,float ra
for (uint32 i=0;i<_Entities.size();++i) 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); 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); // Do not add invisible entity for player
if( c != 0) if( !R2_VISION::isEntityVisibleToPlayers(areaTarget->getWhoSeesMe()))
{ continue;
// Do not add invisible entity for player // Do not add invulnerable entities, they are GM and use a slot for nothing
if( !R2_VISION::isEntityVisibleToPlayers(areaTarget->getWhoSeesMe())) if( areaTarget && areaTarget->invulnerableMode() )
continue; continue;
// Do not add invulnerable entities, they are GM and use a slot for nothing // Do not add the entity if a PVP rule excludes it from being selected
if( areaTarget && areaTarget->invulnerableMode() ) if( ! CPVPManager2::getInstance()->canApplyAreaEffect( c, areaTarget, offensiveAction, ignoreMainTarget ) )
continue; continue;
// Do not add the entity if a PVP rule excludes it from being selected }
if( ! CPVPManager2::getInstance()->canApplyAreaEffect( c, areaTarget, offensiveAction, ignoreMainTarget ) ) else
continue; {
} // Do not add invisible entity for creature
else if( !R2_VISION::isEntityVisibleToMobs(areaTarget->getWhoSeesMe()))
{ continue;
// Do not add invisible entity for creature // Do not add invulnerable entities, they are GM and use a slot for nothing
if( !R2_VISION::isEntityVisibleToMobs(areaTarget->getWhoSeesMe())) if( areaTarget && areaTarget->invulnerableMode() )
continue; continue;
// Do not add invulnerable entities, they are GM and use a slot for nothing
if( areaTarget && areaTarget->invulnerableMode() )
continue;
}
} }
_Entities.push_back(&*it); _Entities.push_back(&*it);