1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-21 21:17:49 +02:00

Merge pull request from IvanSavenko/tavern_fix

[1.6.6] Fix stacking of bonuses from buildings like Tavern
This commit is contained in:
Ivan Savenko 2025-02-15 11:13:21 +02:00 committed by GitHub
commit 5432dc66c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 3 deletions
config/factions
lib/mapObjects

@ -202,6 +202,11 @@
{
"type": "MORALE",
"val": 2
},
{
"propagator": "PLAYER_PROPAGATOR",
"type": "THIEVES_GUILD_ACCESS",
"val": 1
}
],
"upgrades" : "tavern"

@ -754,8 +754,6 @@ void CGTownInstance::recreateBuildingsBonuses()
for(const auto & b : bl)
removeBonus(b);
for(const auto & bid : builtBuildings)
{
bool bonusesReplacedByUpgrade = false;
@ -777,7 +775,12 @@ void CGTownInstance::recreateBuildingsBonuses()
continue;
for(auto & bonus : building->buildingBonuses)
addNewBonus(bonus);
{
// Add copy of bonus to bonus system
// Othervice, bonuses with player or global propagator will not stack if player has multiple towns of same faction
auto bonusCopy = std::make_shared<Bonus>(*bonus);
addNewBonus(bonusCopy);
}
}
}