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

◆ TryFindingShimmerFreeSpot()

Vector2? Terraria.Player.TryFindingShimmerFreeSpot ( )
inlineprivate

Definition at line 26732 of file Player.cs.

26733 {
26734 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
26735 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
26736 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
26737 //IL_001f: Unknown result type (might be due to invalid IL or missing references)
26738 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
26739 //IL_0042: Unknown result type (might be due to invalid IL or missing references)
26740 //IL_010b: Unknown result type (might be due to invalid IL or missing references)
26741 //IL_00c4: Unknown result type (might be due to invalid IL or missing references)
26742 Point point = base.Top.ToTileCoordinates();
26743 int num = 60;
26744 Vector2? result = null;
26745 bool allowSolidTop = true;
26746 for (int i = 1; i < num; i += 2)
26747 {
26748 Vector2? vector = ShimmerHelper.FindSpotWithoutShimmer(this, point.X, point.Y, i, allowSolidTop);
26749 if (vector.HasValue)
26750 {
26751 result = vector.Value;
26752 break;
26753 }
26754 }
26755 FindSpawn();
26756 if (!CheckSpawn(SpawnX, SpawnY))
26757 {
26758 SpawnX = -1;
26759 SpawnY = -1;
26760 }
26761 if (!result.HasValue && SpawnX != -1 && SpawnY != -1)
26762 {
26763 for (int j = 1; j < num; j += 2)
26764 {
26766 if (vector2.HasValue)
26767 {
26768 result = vector2.Value;
26769 break;
26770 }
26771 }
26772 }
26773 if (!result.HasValue)
26774 {
26775 for (int k = 1; k < num; k += 2)
26776 {
26777 Vector2? vector3 = ShimmerHelper.FindSpotWithoutShimmer(this, Main.spawnTileX, Main.spawnTileY, k, allowSolidTop);
26778 if (vector3.HasValue)
26779 {
26780 result = vector3.Value;
26781 break;
26782 }
26783 }
26784 }
26785 return result;
26786 }
static ? Vector2 FindSpotWithoutShimmer(Entity entity, int startX, int startY, int expand, bool allowSolidTop)
static bool CheckSpawn(int x, int y)
Definition Player.cs:55231
void FindSpawn()
Definition Player.cs:55276

References Terraria.Player.CheckSpawn(), Terraria.Player.FindSpawn(), Terraria.GameContent.ShimmerHelper.FindSpotWithoutShimmer(), Terraria.Main.spawnTileX, Terraria.Main.spawnTileY, Terraria.Player.SpawnX, and Terraria.Player.SpawnY.

Referenced by Terraria.Player.ShimmerUnstuck().

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