Skip to content

Commit

Permalink
Fix #3688 (Terrarian Legendary prefix exception)
Browse files Browse the repository at this point in the history
  • Loading branch information
JavidPack committed Aug 14, 2023
1 parent beae839 commit 9ca5fd1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions patches/tModLoader/Terraria/ModLoader/PrefixLoader.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Terraria.GameContent.Prefixes;
using Terraria.ID;
using Terraria.ModLoader.Core;
using Terraria.Utilities;
Expand Down Expand Up @@ -97,6 +98,8 @@ public static bool CanRoll(Item item, int prefix)
if (Item.GetVanillaPrefixes(category).Contains(prefix))
return true;
}
if (PrefixLegacy.ItemSets.ItemsThatCanHaveLegendary2[item.type] && prefix == PrefixID.Legendary2) // Fix #3688
return true;

return false;
}
Expand Down Expand Up @@ -127,6 +130,9 @@ void AddCategory(PrefixCategory category)
foreach (int pre in Item.GetVanillaPrefixes(category))
wr.Add(pre, 1);

if(PrefixLegacy.ItemSets.ItemsThatCanHaveLegendary2[item.type]) // Fix #3688, Rather than mess with the PrefixCategory enum and Item.GetPrefixCategory at this time and risk compatibility issues, manually support this until a redesign.
wr.Add(PrefixID.Legendary2, 1);

AddCategory(category);
if (IsWeaponSubCategory(category))
AddCategory(PrefixCategory.AnyWeapon);
Expand Down

0 comments on commit 9ca5fd1

Please sign in to comment.