- if (freepods == 0)
- break;
- if (freepods < caproids)
- caproids = caproids - freepods;
-
- roids->second.push_back(roids->second[0] - caproids);
- hostiletemp->killFleet(unittype, caproids, 1);
+ if (hostiletemp->freePodGuns(1) <= 0)
+ break;
+ if (hostiletemp->freePodGuns(1) < caproids)
+ caproids = hostiletemp->freePodGuns(1);
+
+ cerr << caproids << " roids stolen\n";
+
+ takeRoids(roid->first, caproids, tick);
+
+ /*FIXME: REMOVE THIS BLOCK LATER
+ //FIXME: Going to move this to the distribute roids section instead.. Not really move, I'll keep this, but "regenerate" the pods in the distribute ships function.
+ hostiletemp->killFleet(unittype, caproids, 1);
+ pods[unittype] += caproids;
+ //int totroids = caproids + hostiletemp->resource(roid->first, 0);
+ */
+ hostiletemp->addResource(roid->first, caproids, 1);
+ hostiletemp->usePodGuns(1, caproids);
+ cerr << caproids << " stolen " << roid->first << " roids\n";
+ }