@@ -1608,38 +1608,6 @@ Waypoint *TerrainLogic::getClosestWaypointOnPath( const Coord3D *pos, AsciiStrin
16081608 return pClosestWay;
16091609}
16101610
1611- // -------------------------------------------------------------------------------------------------
1612- /* * Return shipyard building locations for a player sorted by distance to pos */
1613- // -------------------------------------------------------------------------------------------------
1614- std::vector<Waypoint*> TerrainLogic::getShipyardBuildPositions (const Coord3D* pos, AsciiString label)
1615- {
1616- std::vector<Waypoint*> ret;
1617- if (label.isEmpty ()) {
1618- DEBUG_LOG ((" ***Warning - asking for empty path label." ));
1619- return ret;
1620- }
1621-
1622- for (Waypoint* way = m_waypointListHead; way; way = way->getNext ()) {
1623- Bool match = false ;
1624- if (label.compareNoCase (way->getPathLabel1 ()) == 0 ) match = true ;
1625- if (label.compareNoCase (way->getPathLabel2 ()) == 0 ) match = true ;
1626- if (label.compareNoCase (way->getPathLabel3 ()) == 0 ) match = true ;
1627- if (match) {
1628- ret.push_back (way);
1629- }
1630- }
1631-
1632- std::sort (ret.begin (), ret.end (), [=](const Waypoint* a, const Waypoint* b) {
1633- const Coord3D* posA = a->getLocation ();
1634- const Coord3D* posB = b->getLocation ();
1635- Real distAsqr = (posA->x - pos->x ) * (posA->x - pos->x ) + (posA->y - pos->y ) * (posA->y - pos->y );
1636- Real distBsqr = (posB->x - pos->x ) * (posB->x - pos->x ) + (posB->y - pos->y ) * (posB->y - pos->y );
1637- return distAsqr < distBsqr;
1638- });
1639-
1640- return ret;
1641- }
1642-
16431611// -------------------------------------------------------------------------------------------------
16441612/* * Return true if the waypoint path containing pWay is labeled with the label. */
16451613// -------------------------------------------------------------------------------------------------
0 commit comments