From: <geo...@us...> - 2009-09-11 07:32:03
|
Revision: 3159 http://freeorion.svn.sourceforge.net/freeorion/revision/?rev=3159&view=rev Author: geoffthemedio Date: 2009-09-11 07:31:57 +0000 (Fri, 11 Sep 2009) Log Message: ----------- Made resource supply connected systems provide fleet supply Modified Paths: -------------- trunk/FreeOrion/universe/Fleet.cpp trunk/FreeOrion/universe/Ship.cpp Modified: trunk/FreeOrion/universe/Fleet.cpp =================================================================== --- trunk/FreeOrion/universe/Fleet.cpp 2009-09-11 06:08:45 UTC (rev 3158) +++ trunk/FreeOrion/universe/Fleet.cpp 2009-09-11 07:31:57 UTC (rev 3159) @@ -696,10 +696,16 @@ std::set<int> fleet_supplied_systems; const std::set<int>& owners = 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()); + if (const Empire* empire = Empires().Lookup(*it)) { + // add systems that receive fleet supply + const std::set<int>& empire_fleet_supplied_systems = empire->FleetSupplyableSystemIDs(); + fleet_supplied_systems.insert(empire_fleet_supplied_systems.begin(), empire_fleet_supplied_systems.end()); + + // also add any system that is connected to a planet for resource sharing purposes + const std::set<std::set<int> >& empire_resource_supply_groups = empire->ResourceSupplyGroups(); + for (std::set<std::set<int> >::const_iterator set_set_it = empire_resource_supply_groups.begin(); set_set_it != empire_resource_supply_groups.end(); ++set_set_it) + fleet_supplied_systems.insert(set_set_it->begin(), set_set_it->end()); + } } //Logger().debugStream() << "Fleet Supplied Systems:"; //for (std::set<int>::const_iterator it = fleet_supplied_systems.begin(); it != fleet_supplied_systems.end(); ++it) Modified: trunk/FreeOrion/universe/Ship.cpp =================================================================== --- trunk/FreeOrion/universe/Ship.cpp 2009-09-11 06:08:45 UTC (rev 3158) +++ trunk/FreeOrion/universe/Ship.cpp 2009-09-11 07:31:57 UTC (rev 3159) @@ -128,6 +128,7 @@ Meter* meter = GetMeter(METER_FUEL); assert(meter); meter->SetCurrent(meter->Max()); + for (ConsumablesMap::iterator it = m_fighters.begin(); it != m_fighters.end(); ++it) { @@ -135,6 +136,7 @@ it->second.first * boost::get<FighterStats>(GetPartType(it->first)->Stats()).m_capacity; } + for (ConsumablesMap::iterator it = m_missiles.begin(); it != m_missiles.end(); ++it) { |