Skip to content

Commit db16f12

Browse files
author
luiza.torello
committed
fix: keep original dictionaries for dialogue
1 parent ce2f723 commit db16f12

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Assets/Scripts/Game/NarrativeGenerator/Quests/ProfileQuests/Achievement/ExchangeQuestSo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public override void Init()
4040
{
4141
base.Init();
4242
ItemsToExchangeByType = new ItemAmountDictionary();
43-
OriginalItemsToExchangeByType = ItemsToExchangeByType.Clone();
43+
OriginalItemsToExchangeByType = (ItemAmountDictionary)ItemsToExchangeByType.Clone();
4444
Npc = null;
4545
HasItems = false;
4646
HasCreatedDialogue = false;
@@ -55,7 +55,7 @@ public override void Init(QuestSo copiedQuest)
5555
{
5656
Npc = exchangeQuest.Npc;
5757
ItemsToExchangeByType = (ItemAmountDictionary) exchangeQuest.ItemsToExchangeByType.Clone();
58-
OriginalItemsToExchangeByType = ItemsToExchangeByType.Clone();
58+
OriginalItemsToExchangeByType = (ItemAmountDictionary)ItemsToExchangeByType.Clone();
5959
ExchangeData = exchangeQuest.ExchangeData;
6060
HasItems = exchangeQuest.HasItems;
6161
HasCreatedDialogue = exchangeQuest.HasCreatedDialogue;
@@ -72,7 +72,7 @@ public void Init( string questName, bool endsStoryLine, QuestSo previous, NpcSo
7272
base.Init(questName, endsStoryLine, previous);
7373
Npc = npc;
7474
ItemsToExchangeByType = exchangedItems;
75-
OriginalItemsToExchangeByType = ItemsToExchangeByType.Clone();
75+
OriginalItemsToExchangeByType = (ItemAmountDictionary)ItemsToExchangeByType.Clone();
7676
ExchangeData =
7777
new ExchangeQuestData((ItemAmountDictionary) ItemsToExchangeByType.Clone(), receivedItem, Id);
7878
HasItems = false;

Assets/Scripts/Game/NarrativeGenerator/Quests/ProfileQuests/Achievement/GatherQuestSo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public override void Init()
2323
{
2424
base.Init();
2525
ItemsToGatherByType = new ItemAmountDictionary();
26-
OriginalItemsToGatherByType = ItemsToGatherByType.Clone();
26+
OriginalItemsToGatherByType = (ItemAmountDictionary)ItemsToGatherByType.Clone();
2727
}
2828

2929
public override void Init(QuestSo copiedQuest)
@@ -33,7 +33,7 @@ public override void Init(QuestSo copiedQuest)
3333
if (getQuest != null)
3434
{
3535
ItemsToGatherByType = (ItemAmountDictionary) getQuest.ItemsToGatherByType.Clone();
36-
OriginalItemsToGatherByType = ItemsToGatherByType.Clone();
36+
OriginalItemsToGatherByType = (ItemAmountDictionary)ItemsToGatherByType.Clone();
3737
}
3838
else
3939
{
@@ -46,7 +46,7 @@ public void Init(string questName, bool endsStoryLine, QuestSo previous, ItemAmo
4646
{
4747
base.Init(questName, endsStoryLine, previous);
4848
ItemsToGatherByType = itemsByType;
49-
OriginalItemsToGatherByType = ItemsToGatherByType.Clone();
49+
OriginalItemsToGatherByType = (ItemAmountDictionary)ItemsToGatherByType.Clone();
5050
}
5151

5252
public override QuestSo Clone()

Assets/Scripts/Game/NarrativeGenerator/Quests/ProfileQuests/Mastery/KillQuestSo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ public override void Init()
2929
base.Init();
3030
EnemiesToKillByType = new EnemiesByType();
3131
EnemiesToKillByFitness = new Dictionary<float, int>();
32-
OriginalEnemiesToKillByType = EnemiesToKillByType.Clone();
32+
OriginalEnemiesToKillByType = new EnemiesByType();
3333
}
3434

3535
public void Init(string questName, bool endsStoryLine, QuestSo previous, EnemiesByType enemiesByType)
3636
{
3737
base.Init(questName, endsStoryLine, previous);
3838
EnemiesToKillByType = enemiesByType;
39-
OriginalEnemiesToKillByType = EnemiesToKillByType.Clone();
39+
OriginalEnemiesToKillByType = enemiesByType;
4040
}
4141
public void Init(string questName, bool endsStoryLine, QuestSo previous, Dictionary<float, int> enemiesByFitness)
4242
{
@@ -52,7 +52,7 @@ public override void Init(QuestSo copiedQuest)
5252
if (killQuest != null)
5353
{
5454
EnemiesToKillByType.EnemiesByTypeDictionary = (WeaponTypeAmountDictionary) killQuest.EnemiesToKillByType.EnemiesByTypeDictionary.Clone();
55-
OriginalEnemiesToKillByType = EnemiesToKillByType.Clone();
55+
OriginalEnemiesToKillByType.EnemiesByTypeDictionary = (WeaponTypeAmountDictionary) killQuest.EnemiesToKillByType.EnemiesByTypeDictionary.Clone();
5656
}
5757
else
5858
{

0 commit comments

Comments
 (0)