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

◆ UpdatePosition()

void Terraria.Projectile.UpdatePosition ( Vector2 wetVelocity)
inlineprivate

Definition at line 19456 of file Projectile.cs.

19457 {
19458 //IL_0124: Unknown result type (might be due to invalid IL or missing references)
19459 //IL_012a: Unknown result type (might be due to invalid IL or missing references)
19460 //IL_012f: Unknown result type (might be due to invalid IL or missing references)
19461 //IL_0134: Unknown result type (might be due to invalid IL or missing references)
19462 //IL_0110: Unknown result type (might be due to invalid IL or missing references)
19463 //IL_0115: Unknown result type (might be due to invalid IL or missing references)
19464 //IL_0116: Unknown result type (might be due to invalid IL or missing references)
19465 //IL_011b: Unknown result type (might be due to invalid IL or missing references)
19466 //IL_0199: Unknown result type (might be due to invalid IL or missing references)
19467 //IL_019f: Unknown result type (might be due to invalid IL or missing references)
19468 //IL_01b6: Unknown result type (might be due to invalid IL or missing references)
19469 //IL_01bb: Unknown result type (might be due to invalid IL or missing references)
19470 //IL_01c2: Unknown result type (might be due to invalid IL or missing references)
19471 //IL_01d3: Unknown result type (might be due to invalid IL or missing references)
19472 //IL_01e4: Unknown result type (might be due to invalid IL or missing references)
19473 //IL_01f5: Unknown result type (might be due to invalid IL or missing references)
19474 if (aiStyle == 4 || aiStyle == 38 || aiStyle == 84 || aiStyle == 148 || (aiStyle == 7 && ai[0] == 2f) || ((type == 440 || type == 449 || type == 606) && ai[1] == 1f) || (aiStyle == 93 && ai[0] < 0f) || type == 540 || type == 756 || type == 818 || type == 856 || type == 961 || type == 933 || ProjectileID.Sets.IsAGolfBall[type] || !ProjectileLoader.ShouldUpdatePosition(this))
19475 {
19476 return;
19477 }
19478 if (wet)
19479 {
19481 }
19482 else
19483 {
19484 position += velocity;
19485 }
19486 if (Main.projPet[type] && tileCollide)
19487 {
19488 bool fall = false;
19489 if (aiStyle == 62)
19490 {
19491 fall = true;
19492 }
19493 switch (type)
19494 {
19495 case 317:
19496 case 387:
19497 case 388:
19498 case 533:
19499 case 759:
19500 fall = true;
19501 break;
19502 }
19503 Vector4 vector = Collision.SlopeCollision(position, velocity, width, height, 0f, fall);
19504 position.X = vector.X;
19505 position.Y = vector.Y;
19506 velocity.X = vector.Z;
19507 velocity.Y = vector.W;
19508 }
19509 }
bool wet
The Entity is currently in water. Projectile: Affects movement speed and some projectiles die when ...
Definition Entity.cs:57
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
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 bool[] IsAGolfBall
If true for a given projectile type (F:Terraria.Projectile.type), then that projectile is a kind of g...
static bool ShouldUpdatePosition(Projectile projectile)
This serves as the central class from which projectile-related functions are carried out....
int aiStyle
Selects which vanilla code to use for the AI method. Vanilla projectile AI styles are enumerated in t...
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
bool tileCollide
If true, the projectile will collide with tiles, usually bouncing or killing the tile depending on M:...

References Terraria.Projectile.ai, Terraria.Projectile.aiStyle, Terraria.Entity.height, Terraria.ID.ProjectileID.Sets.IsAGolfBall, Terraria.Entity.position, Terraria.Main.projPet, Terraria.ModLoader.ProjectileLoader.ShouldUpdatePosition(), Terraria.Collision.SlopeCollision(), Terraria.Projectile.tileCollide, Terraria.Projectile.type, Terraria.Entity.velocity, Terraria.Entity.wet, and Terraria.Entity.width.

Referenced by Terraria.Projectile.HandleMovement().

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