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

◆ IsPlayerInFrontOfDirtWall()

static bool Terraria.GameContent.RGB.CommonConditions.Depth.IsPlayerInFrontOfDirtWall ( Player player)
inlinestaticprivate

Definition at line 193 of file CommonConditions.cs.

194 {
195 Point point = player.Center.ToTileCoordinates();
196 if (!WorldGen.InWorld(point.X, point.Y))
197 {
198 return false;
199 }
200 if (Main.tile[point.X, point.Y] == null)
201 {
202 return false;
203 }
204 switch (Main.tile[point.X, point.Y].wall)
205 {
206 case 2:
207 case 16:
208 case 54:
209 case 55:
210 case 56:
211 case 57:
212 case 58:
213 case 59:
214 case 61:
215 case 170:
216 case 171:
217 case 185:
218 case 196:
219 case 197:
220 case 198:
221 case 199:
222 case 212:
223 case 213:
224 case 214:
225 case 215:
226 return true;
227 default:
228 return false;
229 }
230 }

References Terraria.Entity.Center, Terraria.WorldGen.InWorld(), Terraria.Main.tile, Microsoft.Xna.Framework.Point.X, and Microsoft.Xna.Framework.Point.Y.