engine/maps/source/MapUtils.cpp
// Check to see if there is a creature (any!) adjacent to the creature
// represented by the given creature ID
Check to see if there is a creature (any!) adjacent to the creature
represented by the given creature ID
Check to see if there is a creature ( any! ) adjacent to the creature represented by the given creature ID
bool MapUtils::adjacent_creature_exists(CreaturePtr creature, MapPtr map)
{
  if (map)
  {
    std::map<Direction, TilePtr> adjacent_tiles = MapUtils::get_adjacent_tiles_to_creature(map, creature);
    for (std::map<Direction, TilePtr>::const_iterator t_it = adjacent_tiles.begin(); t_it != adjacent_tiles.end(); t_it++)
    {
      TilePtr tile = t_it->second;
      if (tile && tile->has_creature())
      {
        return true;
      }
    }
  }
  return false;
}
bool MapUtils :: adjacent_creature_exists ( CreaturePtr creature , MapPtr map ) { if ( map ) { std :: map < Direction , TilePtr > adjacent_tiles = MapUtils :: get_adjacent_tiles_to_creature ( map , creature ) ; for ( std :: map < Direction , TilePtr > :: const_iterator t_it = adjacent_tiles . begin ( ) ; t_it != adjacent_tiles . end ( ) ; t_it ++ ) { TilePtr tile = t_it -> second ; if ( tile && tile -> has_creature ( ) ) { return true ; } } } return false ; }
Check to see if there is a creature (any!)
Check to see if there is a creature ( any! )