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

◆ ItemCheck_ReleaseCritter()

void Terraria.Player.ItemCheck_ReleaseCritter ( Item sItem)
inlineprivate

Definition at line 43213 of file Player.cs.

43214 {
43215 //IL_0023: Unknown result type (might be due to invalid IL or missing references)
43216 //IL_002f: Unknown result type (might be due to invalid IL or missing references)
43217 if (sItem.makeNPC == 614)
43218 {
43220 NPC.ReleaseNPC((int)base.Center.X, (int)base.Bottom.Y, sItem.makeNPC, sItem.placeStyle, whoAmI);
43221 }
43222 else if (position.X / 16f - (float)tileRangeX - (float)sItem.tileBoost <= (float)tileTargetX && (position.X + (float)width) / 16f + (float)tileRangeX + (float)sItem.tileBoost - 1f >= (float)tileTargetX && position.Y / 16f - (float)tileRangeY - (float)sItem.tileBoost <= (float)tileTargetY && (position.Y + (float)height) / 16f + (float)tileRangeY + (float)sItem.tileBoost - 2f >= (float)tileTargetY)
43223 {
43224 int num = Main.mouseX + (int)Main.screenPosition.X;
43225 int num2 = Main.mouseY + (int)Main.screenPosition.Y;
43226 int i2 = num / 16;
43227 int i = num2 / 16;
43228 if (!WorldGen.SolidTile(i2, i))
43229 {
43231 NPC.ReleaseNPC(num, num2, sItem.makeNPC, sItem.placeStyle, whoAmI);
43232 }
43233 }
43234 }
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
static int tileTargetY
Definition Player.cs:2652
static int tileRangeX
Definition Player.cs:2642
static int tileTargetX
Definition Player.cs:2650
void ApplyItemTime(Item sItem, float multiplier=1f, bool? callUseItem=null)
Definition Player.cs:4907
static int tileRangeY
Definition Player.cs:2644

References Terraria.Player.ApplyItemTime(), Terraria.Entity.height, Terraria.Entity.position, Terraria.NPC.ReleaseNPC(), Terraria.Main.screenPosition, Terraria.WorldGen.SolidTile(), Terraria.Player.tileRangeX, Terraria.Player.tileRangeY, Terraria.Player.tileTargetX, Terraria.Player.tileTargetY, Terraria.Entity.whoAmI, and Terraria.Entity.width.

Referenced by Terraria.Player.ItemCheck_OwnerOnlyCode().

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