Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion Assets/Scripts/Game/Formulas/FormulaHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3025,9 +3025,23 @@ public static string GenerateBuildingName(int seed, DFLocation.BuildingTypes typ
break;

case DFLocation.BuildingTypes.Temple:
// Temples get name from faction data - always seem to be first child of factionID
// Temples get name from faction data - always seem to be first child of the top-level factionID
if (GameManager.Instance.PlayerEntity.FactionData.GetFactionData(factionID, out factionData))
{
// Traverse up to find the top-level faction
while (factionData.parent != 0)
{
if (GameManager.Instance.PlayerEntity.FactionData.GetFactionData(factionData.parent, out FactionFile.FactionData parentFaction))
{
factionData = parentFaction;
}
else
{
break; // If we can't find the parent, stop the loop
}
}

// Now that we have the top-level faction, get its first child
if (factionData.children.Count > 0)
{
FactionFile.FactionData firstChild;
Expand Down