1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Merge pull request #587 from Ewilhan/fixNeutralCreaturesGrowth

Fix Neutral Creatures Weekly Growth
This commit is contained in:
Alexander Shishkin
2019-05-06 19:06:40 +03:00
committed by GitHub

View File

@@ -1673,8 +1673,12 @@ void CGameHandler::newTurn()
if (monthType < 25) if (monthType < 25)
{ {
n.specialWeek = NewTurn::BONUS_GROWTH; //+5 n.specialWeek = NewTurn::BONUS_GROWTH; //+5
std::pair<int, CreatureID> newMonster(54, VLC->creh->pickRandomMonster(getRandomGenerator())); std::pair<int, CreatureID> newMonster(54, CreatureID());
//TODO do not pick neutrals do
{
newMonster.second = VLC->creh->pickRandomMonster(getRandomGenerator());
} while (VLC->creh->creatures[newMonster.second] &&
VLC->townh->factions[VLC->creh->creatures[newMonster.second]->faction]->town == nullptr); // find first non neutral creature
n.creatureid = newMonster.second; n.creatureid = newMonster.second;
} }
} }