adjust town event handling after introducing 8th creature in town

This commit is contained in:
godric3
2024-09-16 20:16:36 +02:00
parent 7209969d9d
commit 8917c753bd
2 changed files with 8 additions and 3 deletions
+1 -1
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));