1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-03 23:19:22 +02:00

Merge pull request #3743 from dydzio0614/special-factions

Allow factions to be special
This commit is contained in:
Ivan Savenko
2024-04-12 11:49:58 +03:00
committed by GitHub
4 changed files with 10 additions and 1 deletions

View File

@@ -1058,6 +1058,7 @@ CFaction * CTownHandler::loadFromJson(const std::string & scope, const JsonNode
auto preferUndergound = source["preferUndergroundPlacement"];
faction->preferUndergroundPlacement = preferUndergound.isNull() ? false : preferUndergound.Bool();
faction->special = source["special"].Bool();
// NOTE: semi-workaround - normally, towns are supposed to have native terrains.
// Towns without one are exceptions. So, vcmi requires nativeTerrain to be defined
@@ -1249,7 +1250,7 @@ std::set<FactionID> CTownHandler::getDefaultAllowed() const
std::set<FactionID> allowedFactions;
for(auto town : objects)
if (town->town != nullptr)
if (town->town != nullptr && !town->special)
allowedFactions.insert(town->getId());
return allowedFactions;