string unittype = i->second;
- //cerr << "Initiative: " << s_Units[unittype].initiative() << " with unit: " << unittype << endl;
+ cerr << "Initiative: " << s_Units[unittype].initiative() << " with unit: " << unittype << endl;
if (s_Units[unittype].type() == "EMP")
{
if (s_Units[unittype].type() == "Pod")
{
- if (m_iScore <= 0) break;
- float capping = float(m_iScore) / hostile->score() / 10;
-
- cerr << "Capping is: " << capping << endl;
-
- if (capping > 0.15)
- capping = 0.15;
- if (capping <= 0)
- break;
-
- for (RoidList::iterator roid = m_Roids.begin(); roid != m_Roids.end(); ++roid)
+ if (m_iScore > 0)
{
- int caproids = capping * roids(roid->first, tick - 1);
- int freepods = hostiletemp->freeFleet(unittype, 1);
-
- cerr << "Possible to steal " << caproids << " " << roid->first << " roids\n";
- cerr << freepods << " free pods available\n";
-
- if (freepods <= 0)
- break;
- if (freepods < caproids)
- caproids = freepods;
-
- cerr << caproids << " roids stolen\n";
-
- takeRoids(roid->first, caproids, tick);
-
- hostiletemp->killFleet(unittype, caproids, 1);
- int totroids = caproids + hostiletemp->resource(roid->first, 0);
- hostiletemp->setResource(roid->first, totroids, 1);
-
- cerr << totroids << " stolen " << roid->first << " roids\n";
+ float capping = float(m_iScore) / hostile->score() / 10;
+
+ cerr << "Capping is: " << capping << endl;
+
+ if (capping > 0.15)
+ capping = 0.15;
+ if (capping > 0)
+ {
+ for (RoidList::iterator roid = m_Roids.begin(); roid != m_Roids.end(); ++roid)
+ {
+ int caproids = capping * roids(roid->first, tick - 1);
+ int freepods = hostiletemp->freeFleet(unittype, 1);
+
+ cerr << "Possible to steal " << caproids << " " << roid->first << " roids\n";
+ cerr << freepods << " free pods available\n";
+
+ if (freepods <= 0)
+ break;
+ if (freepods < caproids)
+ caproids = freepods;
+
+ cerr << caproids << " roids stolen\n";
+
+ takeRoids(roid->first, caproids, tick);
+
+ //FIXME: Going to move this to the distribute roids section instead..
+ hostiletemp->killFleet(unittype, caproids, 1);
+ int totroids = caproids + hostiletemp->resource(roid->first, 0);
+ hostiletemp->setResource(roid->first, totroids, 1);
+
+ cerr << totroids << " stolen " << roid->first << " roids\n";
+ }
+ }
}
}