From: <tz...@us...> - 2006-02-01 04:00:40
|
Revision: 1719 Author: tzlaine Date: 2006-01-31 20:00:20 -0800 (Tue, 31 Jan 2006) ViewCVS: http://svn.sourceforge.net/freeorion?rev=1719&view=rev Log Message: ----------- Altered ShortestPathImpl() to always return the first and last systems in any valid path that exists between them; previously, it was possible for ShortestPathImpl() to return empty paths when the first and last systems were the same system. Also removed some instrumentation from ServerApp.cpp that was used to fix this bug. Modified Paths: -------------- trunk/FreeOrion/server/ServerApp.cpp trunk/FreeOrion/universe/Universe.cpp Modified: trunk/FreeOrion/server/ServerApp.cpp =================================================================== --- trunk/FreeOrion/server/ServerApp.cpp 2006-02-01 01:53:23 UTC (rev 1718) +++ trunk/FreeOrion/server/ServerApp.cpp 2006-02-01 04:00:20 UTC (rev 1719) @@ -1911,19 +1911,7 @@ m_network_core.SendMessage(TurnProgressMessage( player_it->first, Message::FLEET_MOVEMENT, -1)); for (Universe::const_iterator it = GetUniverse().begin(); it != GetUniverse().end(); ++it) - { - if (Fleet* fleet = dynamic_cast<Fleet*>(it->second)) { - std::cerr << "[PRE MOVE] Fleet \"" << fleet->Name() << "\"'s owner: " - << *it->second->Owners().begin() - << std::endl; - } it->second->MovementPhase(); - if (Fleet* fleet = dynamic_cast<Fleet*>(it->second)) { - std::cerr << "[POST MOVE] Fleet \"" << fleet->Name() << "\"'s owner: " - << *it->second->Owners().begin() - << std::endl; - } - } // find planets which have starved to death @@ -2015,11 +2003,6 @@ GetUniverse().RebuildEmpireViewSystemGraphs(); for (Universe::const_iterator it = GetUniverse().begin(); it != GetUniverse().end(); ++it) { - if (Fleet* fleet = dynamic_cast<Fleet*>(it->second)) { - std::cerr << "[PRE GROWTH] Fleet \"" << fleet->Name() << "\"'s owner: " - << *it->second->Owners().begin() - << std::endl; - } it->second->PopGrowthProductionResearchPhase(); it->second->ClampMeters(); for (MeterType i = MeterType(0); i != NUM_METER_TYPES; i = MeterType(i + 1)) { Modified: trunk/FreeOrion/universe/Universe.cpp =================================================================== --- trunk/FreeOrion/universe/Universe.cpp 2006-02-01 01:53:23 UTC (rev 1718) +++ trunk/FreeOrion/universe/Universe.cpp 2006-02-01 04:00:20 UTC (rev 1719) @@ -497,9 +497,12 @@ } retval.second = distances[system2]; - // note that at this point retval.first will be empty if there was no starlane path from system1 to system2 - if (!retval.first.empty()) { + // note that at this point, if system1 != system2, retval.first will be empty if there was no starlane path from + // system1 to system2 + if (!retval.first.empty() || system1 == system2) { retval.first.push_front(pointer_property_map[current_system]); + if (system1 == system2) + retval.first.push_front(retval.first.front()); } #if 0 // disabled for now |