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

◆ CheckSpawn_Internal()

static bool Terraria.Player.CheckSpawn_Internal ( int x,
int y )
inlinestaticprivate

Definition at line 51059 of file Player.cs.

51060 {
51061 if (x < 10 || x > Main.maxTilesX - 10 || y < 10 || y > Main.maxTilesX - 10)
51062 {
51063 return false;
51064 }
51065 if (Main.tile[x, y - 1] == null)
51066 {
51067 return false;
51068 }
51069 if (!Main.tile[x, y - 1].active() || Main.tile[x, y - 1].type != 79)
51070 {
51071 return false;
51072 }
51073 for (int i = x - 1; i <= x + 1; i++)
51074 {
51075 for (int j = y - 3; j < y; j++)
51076 {
51077 if (Main.tile[i, j] == null)
51078 {
51079 return false;
51080 }
51081 if (Main.tile[i, j].nactive() && Main.tileSolid[Main.tile[i, j].type] && !Main.tileSolidTop[Main.tile[i, j].type])
51082 {
51083 Main.NewText(Language.GetTextValue("Game.BedObstructed"), byte.MaxValue, 240, 20);
51084 return false;
51085 }
51086 }
51087 }
51088 if (!WorldGen.StartRoomCheck(x, y - 1))
51089 {
51090 return false;
51091 }
51092 return true;
51093 }
static string GetTextValue(string key)
Definition Language.cs:15

References Terraria.Localization.Language.GetTextValue(), Terraria.Main.maxTilesX, Terraria.Main.NewText(), Terraria.WorldGen.StartRoomCheck(), Terraria.Main.tile, Terraria.Main.tileSolid, and Terraria.Main.tileSolidTop.