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;
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;