]> ruin.nu Git - hbs.git/commitdiff
fixed an evil vector bug..
authorMichael Andreen <harv@ruin.nu>
Sat, 6 Apr 2002 15:47:38 +0000 (15:47 +0000)
committerMichael Andreen <harv@ruin.nu>
Sat, 6 Apr 2002 15:47:38 +0000 (15:47 +0000)
bs/fleet.cpp

index 7361fe2122b486a4b32b11f7d69e44a3d27a857e..00fb66b7e7005e1d590644d139f6624d4804c63d 100644 (file)
@@ -82,7 +82,8 @@ int Fleet::numberOfShips() const
 
        for (map<string, vector<int> >::const_iterator i = m_Fleet.begin(); i != m_Fleet.end(); ++i)
        {
-               total += i->second[0];
+               if (i->second.size() != 0)
+                       total += i->second[0];
        }
 
        return total;