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

Add debug logging for mods with invalid town building config

This commit is contained in:
Ivan Savenko
2025-07-31 21:58:27 +03:00
parent 2ad75bbde7
commit f773b87cd5

View File

@@ -373,6 +373,9 @@ void CTownHandler::loadBuilding(CTown * town, const std::string & stringID, cons
else else
ret->upgrade = BuildingID::NONE; ret->upgrade = BuildingID::NONE;
if (ret->town->buildings[ret->bid] != nullptr)
logMod->error("Mod %s, faction %s: detected multiple town buildings with ID %d", source.getModScope(), stringID, ret->bid.getNum());
ret->town->buildings[ret->bid].reset(ret); ret->town->buildings[ret->bid].reset(ret);
for(const auto & element : source["marketModes"].Vector()) for(const auto & element : source["marketModes"].Vector())
{ {