From: <geo...@us...> - 2008-06-29 19:26:57
|
Revision: 2614 http://freeorion.svn.sourceforge.net/freeorion/revision/?rev=2614&view=rev Author: geoffthemedio Date: 2008-06-29 12:27:05 -0700 (Sun, 29 Jun 2008) Log Message: ----------- -Reworked Fleet::MovementPhase, hopefully to fix some bugs. Seems to be working a bit better, but thorough testing is still required. -Hopefully fixed some issues where fleet move lines weren't showing up at the start of turns by updating game state before creating UI elements in MapWnd::InitTurn -Removed some python scripts from AI MSVC project file. These aren't edited in MSVC and I don't want to keep track of them all -Made fleet icons scale proportionally of FleetWnd Modified Paths: -------------- trunk/FreeOrion/UI/FleetWnd.cpp trunk/FreeOrion/UI/MapWnd.cpp trunk/FreeOrion/msvc2005/FreeOrion/freeorionca/freeorionca.vcproj trunk/FreeOrion/universe/Fleet.cpp Modified: trunk/FreeOrion/UI/FleetWnd.cpp =================================================================== --- trunk/FreeOrion/UI/FleetWnd.cpp 2008-06-28 19:22:18 UTC (rev 2613) +++ trunk/FreeOrion/UI/FleetWnd.cpp 2008-06-29 19:27:05 UTC (rev 2614) @@ -467,9 +467,7 @@ m_x(x), m_y(y), m_fleet_icon(0), - m_fleet_name_text(new GG::TextControl(h, 0, w - h - 5, FLEET_NAME_HT, m_fleet ? m_fleet->Name() : "<i>" + UserString("FW_NEW_FLEET_LABEL") + "</i>", - GG::GUI::GetGUI()->GetFont(ClientUI::Font(), ClientUI::Pts()), m_fleet ? ClientUI::TextColor() : GG::CLR_BLACK, - GG::FORMAT_RIGHT | GG::FORMAT_VCENTER)), + m_fleet_name_text(0), m_num_ships_stat(0), m_fleet_strength_stat(0), m_fuel_stat(0), @@ -479,6 +477,9 @@ { EnableChildClipping(); + m_fleet_name_text = new GG::TextControl(h, 0, w - h - 5, FLEET_NAME_HT, m_fleet ? m_fleet->Name() : "<i>" + UserString("FW_NEW_FLEET_LABEL") + "</i>", + GG::GUI::GetGUI()->GetFont(ClientUI::Font(), ClientUI::Pts()), m_fleet ? ClientUI::TextColor() : GG::CLR_BLACK, + GG::FORMAT_RIGHT | GG::FORMAT_VCENTER); AttachChild(m_fleet_name_text); if (m_fleet) { @@ -611,7 +612,7 @@ } if (icon) { - m_fleet_icon = new GG::StaticGraphic(ICON_OFFSET, ICON_OFFSET, FLEET_ICON_SZ, FLEET_ICON_SZ, icon, GG::GRAPHIC_FITGRAPHIC); + m_fleet_icon = new GG::StaticGraphic(ICON_OFFSET, ICON_OFFSET, FLEET_ICON_SZ, FLEET_ICON_SZ, icon, GG::GRAPHIC_FITGRAPHIC | GG::GRAPHIC_PROPSCALE); AttachChild(m_fleet_icon); } } Modified: trunk/FreeOrion/UI/MapWnd.cpp =================================================================== --- trunk/FreeOrion/UI/MapWnd.cpp 2008-06-28 19:22:18 UTC (rev 2613) +++ trunk/FreeOrion/UI/MapWnd.cpp 2008-06-29 19:27:05 UTC (rev 2614) @@ -717,7 +717,33 @@ SetAccelerators(); Universe& universe = GetUniverse(); + EmpireManager& manager = HumanClientApp::GetApp()->Empires(); + Empire* empire = manager.Lookup(HumanClientApp::GetApp()->EmpireID()); + if (!empire) { + Logger().errorStream() << "MapWnd::InitTurn couldn't get an empire!"; + return; + } + + // update effect accounting and meter estimates + universe.InitMeterEstimatesAndDiscrepancies(); + + // redo meter estimates with unowned planets marked as owned by player, so accurate predictions of planet + // population is available for currently uncolonized planets + UpdateMeterEstimates(); + + + // determine sytems where fleets can deliver supply, and groups of systems that can exchange resources + for (EmpireManager::iterator it = manager.begin(); it != manager.end(); ++it) { + Empire* empire = it->second; + empire->UpdateSupplyUnobstructedSystems(); + empire->UpdateSystemSupplyRanges(); + empire->UpdateFleetSupply(); + empire->UpdateResourceSupply(); + empire->InitResourcePools(); + } + + Resize(GG::Pt(static_cast<int>(Universe::UniverseWidth() * s_max_scale_factor + GG::GUI::GetGUI()->AppWidth() * 1.5), static_cast<int>(Universe::UniverseWidth() * s_max_scale_factor + GG::GUI::GetGUI()->AppHeight() * 1.5))); @@ -883,6 +909,30 @@ DoSystemIconsLayout(); + + // create animated lines indicating fleet supply flow + for (EmpireManager::iterator it = manager.begin(); it != manager.end(); ++it) { + const std::set<std::pair<int, int> >& fleet_supply_lanes = empire->FleetSupplyStarlaneTraversals(); + for (std::set<std::pair<int, int> >::const_iterator lane_it = fleet_supply_lanes.begin(); lane_it != fleet_supply_lanes.end(); ++lane_it) { + glColor(empire->Color()); + const System* start_sys = universe.Object<System>(lane_it->first); + const System* end_sys = universe.Object<System>(lane_it->second); + raw_starlane_supply_vertices.push_back(start_sys->X()); + raw_starlane_supply_vertices.push_back(start_sys->Y()); + raw_starlane_supply_vertices.push_back(end_sys->X()); + raw_starlane_supply_vertices.push_back(end_sys->Y()); + raw_starlane_supply_colors.push_back(empire->Color().r); + raw_starlane_supply_colors.push_back(empire->Color().g); + raw_starlane_supply_colors.push_back(empire->Color().b); + raw_starlane_supply_colors.push_back(empire->Color().a); + raw_starlane_supply_colors.push_back(empire->Color().r); + raw_starlane_supply_colors.push_back(empire->Color().g); + raw_starlane_supply_colors.push_back(empire->Color().b); + raw_starlane_supply_colors.push_back(empire->Color().a); + } + } + + // remove old fleet buttons for fleets not in systems for (unsigned int i = 0; i < m_moving_fleet_buttons.size(); ++i) { DeleteChild(m_moving_fleet_buttons[i]); @@ -920,45 +970,7 @@ SetFleetMovementLine(*it); - // update effect accounting and meter estimates - universe.InitMeterEstimatesAndDiscrepancies(); - // redo meter estimates with unowned planets marked as owned by player, so accurate predictions of planet - // population is available for currently uncolonized planets - UpdateMeterEstimates(); - - EmpireManager& manager = HumanClientApp::GetApp()->Empires(); - - - // determine sytems where fleets can deliver supply, and groups of systems that can exchange resources - for (EmpireManager::iterator it = manager.begin(); it != manager.end(); ++it) { - Empire* empire = it->second; - empire->UpdateSupplyUnobstructedSystems(); - empire->UpdateSystemSupplyRanges(); - empire->UpdateFleetSupply(); - empire->UpdateResourceSupply(); - empire->InitResourcePools(); - - const std::set<std::pair<int, int> >& fleet_supply_lanes = empire->FleetSupplyStarlaneTraversals(); - for (std::set<std::pair<int, int> >::const_iterator lane_it = fleet_supply_lanes.begin(); lane_it != fleet_supply_lanes.end(); ++lane_it) { - glColor(empire->Color()); - const System* start_sys = universe.Object<System>(lane_it->first); - const System* end_sys = universe.Object<System>(lane_it->second); - raw_starlane_supply_vertices.push_back(start_sys->X()); - raw_starlane_supply_vertices.push_back(start_sys->Y()); - raw_starlane_supply_vertices.push_back(end_sys->X()); - raw_starlane_supply_vertices.push_back(end_sys->Y()); - raw_starlane_supply_colors.push_back(empire->Color().r); - raw_starlane_supply_colors.push_back(empire->Color().g); - raw_starlane_supply_colors.push_back(empire->Color().b); - raw_starlane_supply_colors.push_back(empire->Color().a); - raw_starlane_supply_colors.push_back(empire->Color().r); - raw_starlane_supply_colors.push_back(empire->Color().g); - raw_starlane_supply_colors.push_back(empire->Color().b); - raw_starlane_supply_colors.push_back(empire->Color().a); - } - } - MoveChildUp(m_side_panel); // set turn button to current turn @@ -967,13 +979,11 @@ MoveChildUp(m_turn_update); // are there any sitreps to show? - Empire* empire = manager.Lookup(HumanClientApp::GetApp()->EmpireID()); - assert(empire); m_sitrep_panel->Update(); // HACK! The first time this SitRepPanel gets an update, the report row(s) are misaligned. I have no idea why, and // I am sick of dealing with it, so I'm forcing another update in order to force it to behave. m_sitrep_panel->Update(); - if (empire->NumSitRepEntries()) { + if (empire && empire->NumSitRepEntries()) { AttachChild(m_sitrep_panel); MoveChildUp(m_sitrep_panel); m_sitrep_panel->Show(); @@ -1901,11 +1911,16 @@ std::list<MovePathNode>::const_iterator path_it = move_line.Path().begin(); ++path_it; for (; path_it != move_line.Path().end(); ++path_it) { - // if this vertex can be reached, add vertices for line from previous to this vertex if (path_it->eta == Fleet::ETA_NEVER || path_it->eta == Fleet::ETA_NEVER || path_it->eta == Fleet::ETA_OUT_OF_RANGE) break; // don't render additional legs of path that aren't reachable + double cur_vertex_x = path_it->x, cur_vertex_y = path_it->y; + + // skip zero-length line segments since they seem to cause problems... + if (cur_vertex_x == prev_vertex_x && cur_vertex_y == prev_vertex_y) + continue; + if (!started) { // this is obviously less efficient than using GL_LINE_STRIP, but GL_LINE_STRIP sometimes produces nasty artifacts // when the begining of a line segment starts offscreen @@ -1914,12 +1929,12 @@ started = true; } - glVertex2d(prev_vertex_x, prev_vertex_y); - glVertex2d(path_it->x, path_it->y); + glVertex2d(prev_vertex_x, prev_vertex_y); + glVertex2d(cur_vertex_x, cur_vertex_y); // and update previous vertex for next iteration - prev_vertex_x = path_it->x; - prev_vertex_y = path_it->y; + prev_vertex_x = cur_vertex_x; + prev_vertex_y = cur_vertex_y; } if (started) Modified: trunk/FreeOrion/msvc2005/FreeOrion/freeorionca/freeorionca.vcproj =================================================================== --- trunk/FreeOrion/msvc2005/FreeOrion/freeorionca/freeorionca.vcproj 2008-06-28 19:22:18 UTC (rev 2613) +++ trunk/FreeOrion/msvc2005/FreeOrion/freeorionca/freeorionca.vcproj 2008-06-29 19:27:05 UTC (rev 2614) @@ -577,18 +577,6 @@ > </File> <File - RelativePath="..\..\..\default\AI\ColonisationAI.py" - > - </File> - <File - RelativePath="..\..\..\default\AI\ExplorationAI.py" - > - </File> - <File - RelativePath="..\..\..\default\AI\FreeOrionAI.py" - > - </File> - <File RelativePath="..\..\..\AI\PythonAI.cpp" > </File> Modified: trunk/FreeOrion/universe/Fleet.cpp =================================================================== --- trunk/FreeOrion/universe/Fleet.cpp 2008-06-28 19:22:18 UTC (rev 2613) +++ trunk/FreeOrion/universe/Fleet.cpp 2008-06-29 19:27:05 UTC (rev 2614) @@ -20,6 +20,33 @@ inline bool SystemNotReachable(System* system, int empire_id) { return !GetUniverse().SystemReachable(system->ID(), empire_id); } + + void ResupplyFleetIfPossible(Fleet* fleet) { + if (fleet->SystemID() == UniverseObject::INVALID_OBJECT_ID) + return; + Universe& universe = GetUniverse(); + + // get all supplyable systems + std::set<int> fleet_supplied_systems; + const std::set<int>& owners = fleet->Owners(); + for (std::set<int>::const_iterator it = owners.begin(); it != owners.end(); ++it) { + std::set<int> empire_fleet_supplied_systems; + if (const Empire* empire = Empires().Lookup(*it)) + empire_fleet_supplied_systems = empire->FleetSupplyableSystemIDs(); + fleet_supplied_systems.insert(empire_fleet_supplied_systems.begin(), empire_fleet_supplied_systems.end()); + } + + // give fuel to ships, if fleet is supplyable at this location + if (fleet_supplied_systems.find(fleet->SystemID()) != fleet_supplied_systems.end()) { + for (Fleet::const_iterator ship_it = fleet->begin(); ship_it != fleet->end(); ++ship_it) { + Ship* ship = universe.Object<Ship>(*ship_it); + assert(ship); + Meter* meter = ship->GetMeter(METER_FUEL); + assert(meter); + meter->SetCurrent(meter->Max()); + } + } + } } // static(s) @@ -91,6 +118,9 @@ const std::list<System*>& Fleet::TravelRoute() const { CalculateRoute(); + //Logger().debugStream() << "fleet travel route: "; + //for (std::list<System*>::const_iterator it = m_travel_route.begin(); it != m_travel_route.end(); ++it) + // Logger().debugStream() << "... " << (*it)->Name(); return m_travel_route; } @@ -115,18 +145,27 @@ double fuel = Fuel(); double max_fuel = MaxFuel(); + //Logger().debugStream() << "Fleet " << this->Name() << "MovePath fuel: " << fuel << " sys id: " << this->SystemID(); + // determine all systems where fleet(s) can be resupplied if fuel runs out std::set<int> fleet_supplied_systems; const std::set<int>& owners = this->Owners(); + //Logger().debugStream()<< " ... owners.size: " << owners.size(); for (std::set<int>::const_iterator it = owners.begin(); it != owners.end(); ++it) { + //Logger().debugStream() << " ... ... owner: " << *it; const Empire* empire = Empires().Lookup(*it); std::set<int> empire_fleet_supplied_systems; if (empire) empire_fleet_supplied_systems = empire->FleetSupplyableSystemIDs(); + //Logger().debugStream() << " ... ... supplied systems size: " << empire_fleet_supplied_systems.size(); fleet_supplied_systems.insert(empire_fleet_supplied_systems.begin(), empire_fleet_supplied_systems.end()); } + //Logger().debugStream() << " ... all supplyable systems: "; + //for (std::set<int>::const_iterator it = fleet_supplied_systems.begin(); it != fleet_supplied_systems.end(); ++it) + // Logger().debugStream() << "sys id: " << *it; + // determine if, given fuel available and supplyable systems, fleet will ever be able to move if (fuel < 1.0 && this->GetSystem() && fleet_supplied_systems.find(this->SystemID()) == fleet_supplied_systems.end()) { retval.push_back(MovePathNode(this->X(), this->Y(), true, ETA_OUT_OF_RANGE, this->SystemID())); @@ -325,6 +364,7 @@ const Meter* meter = ship->GetMeter(METER_FUEL); assert(meter); fuel = std::min(fuel, meter->Current()); + Logger().debugStream() << "ship " << ship->Name() << " has fuel: " << meter->Current(); } return fuel; } @@ -361,7 +401,10 @@ { return m_next_system; } double Fleet::Speed() const -{ return m_speed; } +{ + Logger().debugStream() << "Fleet " << this->Name() << " has speed: " << m_speed; + return m_speed; +} bool Fleet::CanChangeDirectionEnRoute() const { @@ -601,128 +644,122 @@ void Fleet::MovementPhase() { - //Logger().debugStream() << "Fleet::MovementPhase this: " << this; + //Logger().debugStream() << "Fleet::MovementPhase this: " << this->Name() << " id: " << this->ID(); - // determine fuel available to fleet (fuel of the ship that has the least fuel in the fleet) - // and determine the maximum amount of fuel that can be stored by the ship in the fleet that - // can store the least amount of fuel - Universe& universe = GetUniverse(); - double fuel = Meter::METER_MAX; - for (const_iterator ship_it = begin(); ship_it != end(); ++ship_it) { - const Ship* ship = universe.Object<Ship>(*ship_it); - assert(ship); - const Meter* meter = ship->GetMeter(METER_FUEL); - assert(meter); - fuel = std::min(fuel, meter->Current()); + std::list<MovePathNode> move_path = this->MovePath(); + + if (move_path.empty()) { + ResupplyFleetIfPossible(this); + //Logger().debugStream() << "Fleet::MovementPhase: Fleet has empty move path. aborting."; + return; } - System* current_system = GetSystem(); + //Logger().debugStream() << "Fleet::MovementPhase move path:"; + //for (std::list<MovePathNode>::const_iterator it = move_path.begin(); it != move_path.end(); ++it) + // Logger().debugStream() << "... (" << it->x << ", " << it->y << ") at object id: " << it->object_id << " eta: " << it->eta << (it->turn_end ? " (end of turn)" : " (during turn)"); - // if currently in a system, and don't have enough fuel to jump to next system or aren't - // ordered to move, can be supplied fuel this turn - if (current_system && (fuel < 1.0 || m_moving_to == INVALID_OBJECT_ID)) { - // search for this system in systems where fleet(s) can be resupplied if fuel runs out - // get all supplyable systems - std::set<int> fleet_supplied_systems; - const std::set<int>& owners = this->Owners(); - for (std::set<int>::const_iterator it = owners.begin(); it != owners.end(); ++it) { - const Empire* empire = Empires().Lookup(*it); - std::set<int> empire_fleet_supplied_systems; - if (empire) - empire_fleet_supplied_systems = empire->FleetSupplyableSystemIDs(); - fleet_supplied_systems.insert(empire_fleet_supplied_systems.begin(), empire_fleet_supplied_systems.end()); - } + System* current_system = GetSystem(); + int cur_sys_id = SystemID(); + Universe& universe = GetUniverse(); - // give fuel to ships, if fleet is supplyable at this location - if (fleet_supplied_systems.find(current_system->ID()) != fleet_supplied_systems.end()) { - for (const_iterator ship_it = begin(); ship_it != end(); ++ship_it) { - Ship* ship = universe.Object<Ship>(*ship_it); - assert(ship); - Meter* meter = ship->GetMeter(METER_FUEL); - assert(meter); - meter->SetCurrent(meter->Max()); - } - } - return; // can't move fleet this turn + if (move_path.size() == 1) { + //Logger().debugStream() << "Fleet::MovementPhase: Fleet move path has only one entry. doing nothing"; + ResupplyFleetIfPossible(this); // just in case MovePath messed up... + return; } - if (m_moving_to == INVALID_OBJECT_ID) + + std::list<MovePathNode>::const_iterator it = move_path.begin(); + std::list<MovePathNode>::const_iterator next_it = it; next_it++; + // is the ship stuck in a system for a whole turn? + if (current_system && ( // in a system + next_it == move_path.end() || // there is no system after the current one in the path... so won't be moving + next_it->eta > 1 || ( // more than one turn to reach next node. (shouldn't be possible, but just in case...) + it->object_id != UniverseObject::INVALID_OBJECT_ID && // the current and next nodes have the same system id, that is an actual system. thus won't be moving this turn. + it->object_id == next_it->object_id + ) + )) + { + // ship won't move this turn. + ResupplyFleetIfPossible(this); return; + } - if (m_travel_route.empty()) - CalculateRoute(); + Empire* empire = 0; + if (!Owners().empty()) + empire = Empires().Lookup(*Owners().begin()); // assumes one owner empire per fleet - if (current_system && current_system == m_travel_route.front()) - m_travel_route.pop_front(); + double fuel_consumed = 0.0; - // Fleet has a destination to move to, and all ships in fleet can move at least to - // the next system or a full turn's movement along a starlane, whichever is less + for (it = move_path.begin(); it != move_path.end(); ++it) { + next_it = it; ++next_it; - System* next_system = m_travel_route.front(); - double movement_left = m_speed; - while (movement_left > FLEET_MOVEMENT_EPSILON) { - double direction_x = next_system->X() - X(); - double direction_y = next_system->Y() - Y(); - double distance = std::sqrt(direction_x*direction_x + direction_y*direction_y); + System* system = universe.Object<System>(it->object_id); - // if starting update in a system, need at least one unit of fuel to start a jump - if (current_system) { - if (fuel < 1.0) { - movement_left = 0; - break; // done movement this turn - } else { - fuel -= 1; // local tracking of total fleet fuel, so individual ships don't need to be re-checked each update - // deduct fuel from ships to make next leg of jump - for (const_iterator ship_it = begin(); ship_it != end(); ++ship_it) { - Ship* ship = universe.Object<Ship>(*ship_it); - assert(ship); - Meter* meter = ship->GetMeter(METER_FUEL); - assert(meter); - meter->AdjustCurrent(-1.0); - } - } - } + //Logger().debugStream() << "... node " << (system ? system->Name() : "no system"); + // is this system the last node reached this turn? either it's an end of turn node that's not the + // starting node, or there are no more nodes after this one on path + bool node_is_next_stop = it != move_path.begin() && (it->turn_end || next_it == move_path.end()); + //if (node_is_next_stop) Logger().debugStream() << "... ...is next stop"; - if (distance <= movement_left) { - // can jump all the way to the next system + if (system) { // is node a system? + if (empire) + empire->AddExploredSystem(it->object_id); // node is a system. explore it - m_travel_route.pop_front(); - if (m_travel_route.empty()) { - // next system is final destination. insert self into it and explore. + m_prev_system = system->ID(); // passing a system, so update previous system of this fleet - next_system->Insert(this); - movement_left = 0.0; - m_moving_to = m_prev_system = m_next_system = INVALID_OBJECT_ID; - m_travel_route.clear(); - m_travel_distance = 0.0; + if (node_is_next_stop) { // is system the last node reached this turn? + system->Insert(this); // fleet ends turn at this node. insert fleet into system + //Logger().debugStream() << "... ... inserted fleet into system"; + break; + } else { + fuel_consumed += 1.0; // fleet will continue past this system this turn. fuel is consumed to do so. + //Logger().debugStream() << "... ...fuel consumed"; + } + } else { + if (node_is_next_stop) { // node is not a system, but is it the last node reached this turn? + MoveTo(it->x, it->y); // fleet ends turn at this node. move fleet here + //Logger().debugStream() << "... ... moved fleet to position"; - // explore new system - Empire* empire = Empires().Lookup(*Owners().begin()); // assumes one owner empire per fleet - empire->AddExploredSystem(SystemID()); + // find next system + break; + } + } + } - break; // done movement this turn + cur_sys_id = SystemID(); - } else { - // next system is not final destination, so can keep moving after, if there is enough fuel in fleet + //Logger().debugStream() << "Fleet::MovementPhase rest of move path:"; + //for (std::list<MovePathNode>::const_iterator it2 = it; it2 != move_path.end(); ++it2) + // Logger().debugStream() << "... (" << it2->x << ", " << it2->y << ") at object id: " << it2->object_id << " eta: " << it2->eta << (it2->turn_end ? " (end of turn)" : " (during turn)"); - next_system = m_travel_route.front(); - movement_left -= distance; - m_prev_system = m_next_system; - m_next_system = m_travel_route.front()->ID(); - m_travel_distance -= distance; - MoveTo(next_system); - current_system = next_system; + // update next system + if (m_moving_to != cur_sys_id && next_it != move_path.end() && it != move_path.end()) { + //Logger().debugStream() << "scanning rest of path..."; + // find next system on path + for (; next_it != move_path.end(); ++next_it) { + if (universe.Object<System>(next_it->object_id)) { + //Logger().debugStream() << "___ setting m_next_system to " << next_it->object_id; + m_next_system = next_it->object_id; } + } + } else { + m_moving_to = m_next_system = m_prev_system = UniverseObject::INVALID_OBJECT_ID; + } - } else { - // can't make it all the way to the next system. go as far towards it as possible - Move(direction_x / distance * movement_left, direction_y / distance * movement_left); - m_travel_distance -= distance; - movement_left = 0.0; + + // consume fuel + if (fuel_consumed > 0.0) { + for (const_iterator ship_it = begin(); ship_it != end(); ++ship_it) { + Ship* ship = universe.Object<Ship>(*ship_it); + assert(ship); + Meter* meter = ship->GetMeter(METER_FUEL); + assert(meter); + meter->AdjustCurrent(-fuel_consumed); } } } @@ -742,9 +779,10 @@ void Fleet::CalculateRoute() const { + //Logger().debugStream() << "Fleet::CalculateRoute"; if (m_moving_to != INVALID_OBJECT_ID && m_travel_route.empty()) { m_travel_distance = 0.0; - if (SystemID() == m_prev_system) { // if we haven't actually left yet, we have to move from whichever system we are at now + if (m_prev_system != UniverseObject::INVALID_OBJECT_ID && SystemID() == m_prev_system) { // if we haven't actually left yet, we have to move from whichever system we are at now std::pair<std::list<System*>, double> path = GetUniverse().ShortestPath(m_prev_system, m_moving_to, *Owners().begin()); m_travel_route = path.first; m_travel_distance = path.second; @@ -805,7 +843,7 @@ } else { visible_end_it = m_travel_route.end(); } - + int fleet_owner = -1; const std::set<int>& owners = Owners(); if (owners.size() == 1) |