1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

adjust town event handling after introducing 8th creature in town

This commit is contained in:
godric3
2024-09-16 20:16:27 +02:00
parent 7209969d9d
commit 8917c753bd
2 changed files with 8 additions and 3 deletions

View File

@@ -110,7 +110,7 @@ void NewTurnProcessor::handleTownEvents(const CGTownInstance * town)
for (si32 i=0;i<event.creatures.size();i++) //creature growths
{
if (!town->creatures.at(i).second.empty() && event.creatures.at(i) > 0)//there is dwelling
if (i < town->creatures.size() && !town->creatures.at(i).second.empty() && event.creatures.at(i) > 0)//there is dwelling
{
sac.creatures[i].first += event.creatures.at(i);
iw.components.emplace_back(ComponentType::CREATURE, town->creatures.at(i).second.back(), event.creatures.at(i));