Skip to content

Commit

Permalink
Display non-localized region name from older saves
Browse files Browse the repository at this point in the history
Older saves do not contain regionIndex data used to reference localized region names. In these cases fallback to the legacy non-localized regionName in save data. Otherwise player is presented with incorrect region name for quest target in letters, etc.
  • Loading branch information
Interkarma committed Mar 27, 2023
1 parent c8469bd commit c15b4fa
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Assets/Scripts/Game/Questing/Place.cs
Expand Up @@ -268,7 +268,18 @@ public override bool ExpandMacro(MacroTypes macro, out string textOut)
break;

case MacroTypes.NameMacro4: // Name of region (e.g. Tigonus)
textOut = TextManager.Instance.GetLocalizedRegionName(siteDetails.regionIndex);
if (siteDetails.regionIndex == 0 && siteDetails.regionName != "Alik'r Desert")
{
// Workaround for older saves where regionIndex was not present and will always be 0 in save data (Alik'r Desert)
// This can result in improper region name being displayed when loading an older save and quest not actually set in Alik'r Desert.
// In these cases display name using the legacy regionName field stored in place data
textOut = siteDetails.regionName;
}
else
{
// Return localized region name based on regionIndex
textOut = TextManager.Instance.GetLocalizedRegionName(siteDetails.regionIndex);
}
break;

default: // Macro not supported
Expand Down

0 comments on commit c15b4fa

Please sign in to comment.