Skip to content

Commit

Permalink
Null out shopCustomPrice when stacking items to fix 4370 (tModLoader#…
Browse files Browse the repository at this point in the history
  • Loading branch information
JavidPack authored Sep 10, 2024
1 parent 0f01865 commit adecdfa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions patches/tModLoader/Terraria/ModLoader/ItemLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,11 @@ public static void StackItems(Item destination, Item source, out int numTransfer
source.favorited = false;
}

if (destination.shopCustomPrice != source.shopCustomPrice) {
// If attempting to stack items with custom prices, null them out to prevent exploits. Fixes #4370 while preserving normal resell behavior.
destination.shopCustomPrice = null;
}

destination.stack += numTransferred;
if (!infiniteSource)
source.stack -= numTransferred;
Expand Down

0 comments on commit adecdfa

Please sign in to comment.