mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
Allow heroes to start with empty armies if configured properly
This commit is contained in:
@@ -182,7 +182,7 @@ std::vector<SlotInfo> ArmyManager::getBestArmy(const IBonusBearer * armyCarrier,
|
||||
{
|
||||
auto weakest = getWeakestCreature(resultingArmy);
|
||||
|
||||
if(weakest->count == 1)
|
||||
if(weakest != resultingArmy.end() && weakest->count == 1) //we check iterator validity for playing with settings that allow 0 stacks armies
|
||||
{
|
||||
resultingArmy.erase(weakest);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user