Skip to content

Commit

Permalink
Stop "give pc" quest action rearming
Browse files Browse the repository at this point in the history
This quest action could rearm and attempt to give letter multiple times, resulting in an exception loop.
Set "give pc" allowRearm to false. This will prevent issue in future saves and affected saves will self-correct in one quest tick.
Downgraded duplicate item exception to a LogError(). Saves affected by this issue will see error in log and any message popups on next tick, then quest action will switch off properly.
  • Loading branch information
Interkarma committed Mar 3, 2019
1 parent efc46a1 commit cf30e04
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Assets/Scripts/Game/Items/ItemCollection.cs
Expand Up @@ -226,9 +226,12 @@ public void AddItem(DaggerfallUnityItem item, AddPosition position = AddPosition
}
else
{
// Check duplicate key
// Log and exit if duplicate key found
if (items.Contains(item.UID))
throw new Exception("AddItem() encountered a duplicate item UID for " + item.LongName);
{
UnityEngine.Debug.LogError("AddItem() encountered a duplicate item UID for " + item.LongName);
return;
}

// Add the item
switch (position)
Expand Down
3 changes: 2 additions & 1 deletion Assets/Scripts/Game/Questing/Actions/GivePc.cs
@@ -1,4 +1,4 @@
// Project: Daggerfall Tools For Unity
// Project: Daggerfall Tools For Unity
// Copyright: Copyright (C) 2009-2018 Daggerfall Workshop
// Web Site: http://www.dfworkshop.net
// License: MIT License (http://www.opensource.org/licenses/mit-license.php)
Expand Down Expand Up @@ -45,6 +45,7 @@ public override string Pattern
public GivePc(Quest parentQuest)
: base(parentQuest)
{
allowRearm = false;
}

public override IQuestAction CreateNew(string source, Quest parentQuest)
Expand Down

0 comments on commit cf30e04

Please sign in to comment.