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

◆ TryGetPlacementOption()

bool Terraria.GameContent.FlexibleTileWand.TryGetPlacementOption ( Player player,
int randomSeed,
int selectCycleOffset,
out PlacementOption option,
out Item itemToConsume )
inline

Definition at line 87 of file FlexibleTileWand.cs.

88 {
89 option = null;
90 itemToConsume = null;
91 Item[] inventory = player.inventory;
92 for (int i = 0; i < 58; i++)
93 {
94 if (i < 50 || i >= 54)
95 {
96 Item item = inventory[i];
97 if (!item.IsAir && _options.TryGetValue(item.type, out var value))
98 {
100 option = value.GetOptionWithCycling(selectCycleOffset);
101 itemToConsume = item;
102 return true;
103 }
104 }
105 }
106 return false;
107 }
Dictionary< int, OptionBucket > _options

References Terraria.GameContent.FlexibleTileWand._options, Terraria.GameContent.FlexibleTileWand._random, Terraria.Player.inventory, Terraria.Item.IsAir, Terraria.Utilities.UnifiedRandom.SetSeed(), and Terraria.Item.type.

Referenced by Terraria.Player.PlaceThing_Tiles_CheckFlexibleWand().

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