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

◆ SitDown()

void Terraria.NPC.SitDown ( Point anchorTilePosition,
out int direction,
out Vector2 bottom )
inline

Helper method for getting the parameters for seating a town NPC. Assumes the tile at anchorTilePosition is a valid tile for sitting.

Definition at line 112547 of file NPC.cs.

112548 {
112549 //IL_0005: Unknown result type (might be due to invalid IL or missing references)
112550 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
112551 //IL_0035: Unknown result type (might be due to invalid IL or missing references)
112552 //IL_0036: Unknown result type (might be due to invalid IL or missing references)
112553 //IL_004c: Unknown result type (might be due to invalid IL or missing references)
112554 //IL_0052: Unknown result type (might be due to invalid IL or missing references)
112555 //IL_0063: Unknown result type (might be due to invalid IL or missing references)
112556 //IL_0069: Unknown result type (might be due to invalid IL or missing references)
112557 //IL_007f: Unknown result type (might be due to invalid IL or missing references)
112558 //IL_008b: Unknown result type (might be due to invalid IL or missing references)
112559 //IL_00a7: Unknown result type (might be due to invalid IL or missing references)
112560 //IL_00ac: Unknown result type (might be due to invalid IL or missing references)
112561 //IL_00b1: Unknown result type (might be due to invalid IL or missing references)
112562 //IL_00c0: Unknown result type (might be due to invalid IL or missing references)
112563 //IL_00c5: Unknown result type (might be due to invalid IL or missing references)
112564 //IL_00dc: Unknown result type (might be due to invalid IL or missing references)
112565 //IL_00e1: Unknown result type (might be due to invalid IL or missing references)
112566 //IL_00e3: Unknown result type (might be due to invalid IL or missing references)
112567 //IL_00e8: Unknown result type (might be due to invalid IL or missing references)
112568 Tile tile = Main.tile[anchorTilePosition.X, anchorTilePosition.Y];
112569 if (tile.type < TileID.Count)
112570 {
112571 anchorTilePosition.Y--;
112572 }
112573 TileRestingInfo info = new TileRestingInfo(this, anchorTilePosition, Vector2.Zero, (tile.frameX != 0) ? 1 : (-1), 2);
112575 int anchorX = info.AnchorTilePosition.X;
112576 int anchorY = info.AnchorTilePosition.Y;
112577 int directionOffset = info.DirectionOffset;
112578 direction = info.TargetDirection;
112579 Vector2 finalOffset = info.FinalOffset;
112580 bottom = Utils.ToWorldCoordinates(new Point(anchorX, anchorY), 8f, 16f);
112581 bottom.X += direction * directionOffset;
112582 bottom += finalOffset;
112583 }
static readonly ushort Count
Definition TileID.cs:1928
static void ModifySittingTargetInfo(int i, int j, int type, ref TileRestingInfo info)
This serves as the central class from which tile-related functions are supported and carried out.
Definition TileLoader.cs:23
Holds data required for offsetting an entity when it rests on a tile (sitting/sleeping).

References Terraria.ID.TileID.Count, Terraria.Tile.frameX, Terraria.ModLoader.TileLoader.ModifySittingTargetInfo(), Terraria.Main.tile, Terraria.Utils.ToWorldCoordinates(), and Terraria.Tile.type.

Referenced by Terraria.NPC.AI_007_TownEntities(), and Terraria.NPC.AI_007_TryForcingSitting().

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