Fixed vanilla bug of Gold Chests being able to have Meteorite Bars

This commit is contained in:
CongratsIsTrash committed 2025-05-12 15:12:57 -04:00
1 parent 4806624846
commit 37deed0892
1 file changed
+14
+14
View File
@@ -487,6 +487,20 @@ namespace CalamityMod.Systems
}
}
// Fix vanilla's stupidity with Gold Chests being able to have Meteorite Bars in them near the Underworld
if (isGoldChest)
{
for (int inventoryIndex = 0; inventoryIndex < 40; inventoryIndex++)
{
if (chest.item[inventoryIndex].type == ItemID.MeteoriteBar)
{
int oldStack = chest.item[inventoryIndex].stack;
chest.item[inventoryIndex].SetDefaults(WorldGen.genRand.NextBool() ? ItemID.PlatinumBar : ItemID.GoldBar);
chest.item[inventoryIndex].stack = oldStack;
}
}
}
// Give Dead Man's Chests better loot.
if (isDeadManChest)
{