Fixed vanilla bug of Gold Chests being able to have Meteorite Bars
This commit is contained in:
1 parent
4806624846
commit
37deed0892
1 file changed
+14
@@ -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)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user