+ for (UnitList::iterator i = s_Units.begin(); i != s_Units.end(); ++i)
+ {
+ string unittype = i->first;
+
+ cerr << "Distributing type: " << unittype << endl;
+
+ if (m_Fleet[unittype].size() < 1)
+ continue;
+ if (m_Fleet[unittype][0] == 0)
+ continue;
+
+ int totallost = m_Fleet[unittype][1] - m_Fleet[unittype][0];
+
+
+ for (vector<Fleet*>::iterator j = fleets.begin(); j != fleets.end(); ++j)
+ {
+ int lost = totallost * ( (*j)->fleet(unittype, tick - 1) / m_Fleet[unittype][0] );
+ cerr << (*j)->name() << " gaining " << lost << " " << unittype << endl;
+ (*j)->setFleet(unittype, (*j)->fleet(unittype, tick - 1) + lost, tick);
+ }
+ }