]> ruin.nu Git - hbs.git/blobdiff - bs/fleet.cpp
added the possibility to add new fleets..
[hbs.git] / bs / fleet.cpp
index 00fb66b7e7005e1d590644d139f6624d4804c63d..ee22ae7a2759f58b97e35a98b8dffc8dfd4e8728 100644 (file)
@@ -170,7 +170,9 @@ unsigned Fleet::score(int tick = 0) const
 
        for (FleetList::const_iterator i = m_Fleet.begin(); i != m_Fleet.end(); ++i)
        {
-               tot_score += i->second[tick] * s_Units[i->first].totRes() / 10;
+                 if (i->second.size() >= tick)
+                               break;
+                       tot_score += i->second[tick] * s_Units[i->first].totRes() / 10;
        }
 
        return tot_score;