1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Fix multi-creature dwelling only giving town growth bonus to last unit

This commit is contained in:
Ivan Savenko
2025-06-03 15:45:31 +03:00
parent 2a86002aab
commit 032024a432

View File

@@ -201,7 +201,7 @@ int CGTownInstance::getDwellingBonus(const std::vector<CreatureID>& creatureIds,
const auto & dwellingCreatures = dwelling->asOwnable()->providedCreatures(); const auto & dwellingCreatures = dwelling->asOwnable()->providedCreatures();
bool hasMatch = false; bool hasMatch = false;
for (const auto& creature : dwellingCreatures) for (const auto& creature : dwellingCreatures)
hasMatch = vstd::contains(creatureIds, creature); hasMatch |= vstd::contains(creatureIds, creature);
if (hasMatch) if (hasMatch)
totalBonus += 1; totalBonus += 1;