瀏覽代碼

Add debug logging for mods with invalid town building config

Ivan Savenko 4 月之前
父節點
當前提交
f773b87cd5
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      lib/entities/faction/CTownHandler.cpp

+ 3 - 0
lib/entities/faction/CTownHandler.cpp

@@ -373,6 +373,9 @@ void CTownHandler::loadBuilding(CTown * town, const std::string & stringID, cons
 	else
 		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);
 	for(const auto & element : source["marketModes"].Vector())
 	{