Skip to content

Commit

Permalink
fixing bug with named residence not being resolved correctly on info …
Browse files Browse the repository at this point in the history
…click

solves bug report mentioned in https://forums.dfworkshop.net/viewtopic.php?f=24&t=2227

moved player house name handling into function GetBuildingDiscoveryData
so all residence name resolving is done in this function now
  • Loading branch information
Nystul-the-Magician committed Jul 8, 2019
1 parent 6ecc177 commit 2b21914
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Assets/Scripts/Internal/PlayerGPS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1010,12 +1010,7 @@ public bool GetDiscoveredBuilding(int buildingKey, out DiscoveredBuilding discov
return false;

// Get discovery data for building
discoveredBuildingOut = dl.discoveredBuildings[buildingKey];

// Check if name should be overridden (owned house / quest site)
PlayerEntity playerEntity = GameManager.Instance.PlayerEntity;
if (DaggerfallBankManager.IsHouseOwned(buildingKey))
discoveredBuildingOut.displayName = HardStrings.playerResidence.Replace("%s", playerEntity.Name);
bool discovered = GetBuildingDiscoveryData(buildingKey, out discoveredBuildingOut);

return true;
}
Expand Down Expand Up @@ -1138,6 +1133,8 @@ public void ClearDiscoveryData()
/// Does not change discovery state for building.
/// </summary>
/// <param name="buildingKey">Key of building to query.</param>
/// <param name="buildingDiscoveryData">[out] building discovery data of queried building</param>
/// <returns>True if building discovered, false if building not discovered.</returns>
bool GetBuildingDiscoveryData(int buildingKey, out DiscoveredBuilding buildingDiscoveryData)
{
buildingDiscoveryData = new DiscoveredBuilding();
Expand Down Expand Up @@ -1197,6 +1194,11 @@ bool GetBuildingDiscoveryData(int buildingKey, out DiscoveredBuilding buildingDi
buildingDiscoveryData.quality = buildingSummary.Quality;
buildingDiscoveryData.buildingType = buildingSummary.BuildingType;

// Check if name should be overridden (owned house / quest site)
PlayerEntity playerEntity = GameManager.Instance.PlayerEntity;
if (DaggerfallBankManager.IsHouseOwned(buildingKey))
buildingDiscoveryData.displayName = HardStrings.playerResidence.Replace("%s", playerEntity.Name);

return true;
}

Expand Down

3 comments on commit 2b21914

@petchema
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I experienced some regression with this commit,
Forums: https://forums.dfworkshop.net/viewtopic.php?f=28&p=26312#p26312

@Nystul-the-Magician
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for reporting, this has already been reported
the recent pull request (#1345) should solve this

@petchema
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed that one, thanks!

Please sign in to comment.