1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Merge pull request #3435 from IvanSavenko/bugfixing

[1.4.3] Bugfixing
This commit is contained in:
Ivan Savenko
2024-01-06 13:06:07 +02:00
committed by GitHub
14 changed files with 52 additions and 31 deletions

View File

@ -3292,7 +3292,11 @@ void CGameHandler::handleTownEvents(CGTownInstance * town, NewTurn &n)
for (auto & i : ev.buildings)
{
if (!town->hasBuilt(i))
// Only perform action if:
// 1. Building exists in town (don't attempt to build Lvl 5 guild in Fortress
// 2. Building was not built yet
// othervice, silently ignore / skip it
if (town->town->buildings.count(i) && !town->hasBuilt(i))
{
buildStructure(town->id, i, true);
iw.components.emplace_back(ComponentType::BUILDING, BuildingTypeUniqueID(town->getFaction(), i));