engine/maps/source/MapUtils.cpp
// Check to see if there are any creatures hostile to the given creature ID on the map
Check to see if there are any creatures hostile to the given creature ID on the map
Check to see if there are any creatures hostile to the given creature ID on the map
bool MapUtils::hostile_creature_exists(const string& creature_id, MapPtr current_map)
{
  if (current_map)
  {
    map<std::string, CreaturePtr>& creature_map = current_map->get_creatures_ref();
    for (map<string, CreaturePtr>::const_iterator cr_it = creature_map.begin(); cr_it != creature_map.end(); cr_it++)
    {
      CreaturePtr creature = cr_it->second;
      if (creature && creature->hostile_to(creature_id))
      {
        return true;
      }
    }
  }
  return false;
}
bool MapUtils :: hostile_creature_exists ( const string & creature_id , MapPtr current_map ) { if ( current_map ) { map < std :: string , CreaturePtr > & creature_map = current_map -> get_creatures_ref ( ) ; for ( map < string , CreaturePtr > :: const_iterator cr_it = creature_map . begin ( ) ; cr_it != creature_map . end ( ) ; cr_it ++ ) { CreaturePtr creature = cr_it -> second ; if ( creature && creature -> hostile_to ( creature_id ) ) { return true ; } } } return false ; }
Check to see if there are any creatures hostile to the given creature ID on the map
Check to see if there are any creatures hostile to the given creature ID on the map