TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ ClearAmmoSlotSpaces()

static void Terraria.UI.ItemSorting.ClearAmmoSlotSpaces ( )
inlinestatic

Definition at line 1282 of file ItemSorting.cs.

1283 {
1284 Item[] inventory = Main.player[Main.myPlayer].inventory;
1285 for (int i = 54; i < 58; i++)
1286 {
1287 Item item = inventory[i];
1288 if (!item.IsAir && item.ammo != AmmoID.None && item.stack < item.maxStack)
1289 {
1290 RefillItemStack(inventory, item, i + 1, 58);
1291 }
1292 }
1293 for (int j = 54; j < 58; j++)
1294 {
1295 if (inventory[j].type > 0)
1296 {
1297 TrySlidingUp(inventory, j, 54);
1298 }
1299 }
1300 }
static int None
Definition AmmoID.cs:133
AmmoID entries represent ammo types. Ammo items that share the same AmmoID value assigned to F:Terrar...
Definition AmmoID.cs:11
static void TrySlidingUp(Item[] inv, int slot, int minimumIndex)
static void RefillItemStack(Item[] inv, Item itemToRefill, int loopStartIndex, int loopEndIndex)

References Terraria.Item.ammo, Terraria.Item.IsAir, Terraria.Item.maxStack, Terraria.Main.myPlayer, Terraria.ID.AmmoID.None, Terraria.Main.player, Terraria.UI.ItemSorting.RefillItemStack(), Terraria.Item.stack, and Terraria.UI.ItemSorting.TrySlidingUp().

Referenced by Terraria.UI.ItemSorting.SortAmmo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: