]> ruin.nu Git - hbs.git/commitdiff
Fixed a bug in the shipstealing code..
authorMichael Andreen <harv@ruin.nu>
Fri, 10 May 2002 20:45:27 +0000 (20:45 +0000)
committerMichael Andreen <harv@ruin.nu>
Fri, 10 May 2002 20:45:27 +0000 (20:45 +0000)
bs/fleet.cpp
bs/fleet.h
bs/planet.cpp
bs/ui/resourceview.ui

index 19bc3860ef51af974aee0f3c60b14542f58ecb42..85304bb2bfcb6e642826764749ca1bad9a2ea4be 100644 (file)
@@ -801,3 +801,21 @@ void Fleet::calculateSalvage()
                }
        }
 }
+
+//////////////////////////////////////////////////////////////////////////
+//
+void Fleet::resetTicks()
+{
+       for (FleetList::iterator i = m_Fleet.begin(); i != m_Fleet.end(); ++i)
+       {
+               if ( i->second.size() < 2)
+                       continue;
+
+               int temp = i->second[0];
+               i->second.clear();
+
+               if (temp > 0)
+                       i->second.push_back(temp);
+       }
+       resetResources();
+}
index 6696151a51303f0b4f070d05d11d5c422ed07fe4..f632093bd51c8e766c2cd00ecc40f3b85a4e0424 100644 (file)
@@ -274,6 +274,7 @@ public:
         */
        void printFleet();
 
+       void resetTicks();
        //static functions
        //
        /** This function is used to set the different races used.
index f1290ff76502e560ffbcd037037d4f2480e14251..4133277d62d7cc080abfee462df05db499a9756e 100644 (file)
@@ -149,10 +149,10 @@ void Planet::runBattle(std::vector<Fleet*> friendly, std::vector<Fleet*> hostile
        int skipped = 0;
 
        for (vector<Fleet*>::iterator i = friendly.begin(); i != friendly.end(); ++i)
-               (*i)->resetResources();
+               (*i)->resetTicks();
 
        for (vector<Fleet*>::iterator i = hostile.begin(); i != hostile.end(); ++i)
-               (*i)->resetResources();
+               (*i)->resetTicks();
 
        for(int tick = 1; skipped < 20; ++tick)
        {
index 71eae5afe5018a663b5a27753828db9eac7754b7..e1faa9887aff210e377e671a01ea975e07dc4200 100644 (file)
                 <cstring>ScoreLostLabel</cstring>
             </property>
             <property name="text">
-                <string>Lost</string>
+                <string>Difference</string>
+            </property>
+            <property name="toolTip" stdset="0">
+                <string>Shows the difference in score between the selected ticks.</string>
             </property>
         </widget>
         <widget class="QLabel" row="0" column="6" rowspan="1" colspan="2">