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

◆ SplitStack()

static void Terraria.ModLoader.ItemLoader.SplitStack ( Item destination,
Item source,
int numToTransfer )
inlinestatic

Called when splitting a stack of items.

Parameters
destinationThe item instance that source will transfer items to, and is usually a clone of source .
This parameter's stack will be set to zero before any transfer occurs.
sourceThe item instance being stacked onto destination
numToTransferThe quantity of source that will be transferred to destination

Definition at line 1931 of file ItemLoader.cs.

1932 {
1933 destination.stack = 0;
1934 destination.favorited = false;
1936 while (enumerator.MoveNext())
1937 {
1938 enumerator.Current.SplitStack(destination, source, numToTransfer);
1939 }
1940 destination.ModItem?.SplitStack(source, numToTransfer);
1941 destination.stack += numToTransfer;
1942 source.stack -= numToTransfer;
1943 }
static GlobalHookList< GlobalItem > HookSplitStack

References Terraria.ModLoader.ItemLoader.HookSplitStack.

Referenced by Terraria.ModLoader.ItemLoader.TransferWithLimit().

+ Here is the caller graph for this function: