Code: Select all
Exception: GetRegionFaction() found more than 1 matching NPC faction for region 60.
DaggerfallWorkshop.Game.Player.PersistentFactionData.GetRegionFaction (Int32 regionIndex, DaggerfallConnect.Arena2.FactionData& factionData, Boolean duplicateException) (at Assets/Scripts/Game/Player/PersistentFactionData.cs:272)
DaggerfallWorkshop.Game.Formulas.FormulaHelper.GetVampireClan (Int32 regionIndex) (at Assets/Scripts/Game/Formulas/FormulaHelper.cs:385)
DaggerfallWorkshop.Game.MagicAndEffects.MagicEffects.VampirismInfection.get_InfectionVampireClan () (at Assets/Scripts/Game/MagicAndEffects/Effects/Diseases/VampirismInfection.cs:60)
DaggerfallWorkshop.Game.MagicAndEffects.MagicEffects.VampirismInfection.DeployFullBlownVampirism () (at Assets/Scripts/Game/MagicAndEffects/Effects/Diseases/VampirismInfection.cs:177)
DaggerfallWorkshop.Game.UserInterface.UserInterfaceWindow.RaiseOnCloseHandler () (at Assets/Scripts/Game/UserInterface/UserInterfaceWindow.cs:174)
DaggerfallWorkshop.Game.UserInterface.UserInterfaceWindow.CloseWindow () (at Assets/Scripts/Game/UserInterface/UserInterfaceWindow.cs:130)
DaggerfallWorkshop.Game.UserInterfaceWindows.DaggerfallVidPlayerWindow.Update () (at Assets/Scripts/Game/UserInterfaceWindows/DaggerfallVidPlayerWindow.cs:144)
DaggerfallWorkshop.Game.DaggerfallUI.Update () (at Assets/Scripts/Game/DaggerfallUI.cs:363)
It appears that the only way to distinguish is using the ggroup which is 15 (Region) for the correct entry. The only two type 7 entries that aren't a region are #350 and #358 (Orsinium) and neither have a ggroup of 15.
So I think that PersistentFactionData.GetRegionFaction() needs to pass 15 for the second param to FindFactions() but this could have consequences beyond my knowledge so I'd like this to be checked by Interkarma.
My proposed fix is:
Code: Select all
public void GetRegionFaction(int regionIndex, out FactionFile.FactionData factionData, bool duplicateException = true)
{
FactionFile.FactionData[] factions = GameManager.Instance.PlayerEntity.FactionData.FindFactions(
(int)FactionFile.FactionTypes.Province, -1, (int)FactionFile.GuildGroups.Region, regionIndex);