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

◆ FromArea()

static SurfaceMap Terraria.GameContent.Biomes.Desert.SurfaceMap.FromArea ( int startX,
int width )
inlinestatic

Definition at line 43 of file SurfaceMap.cs.

44 {
45 int num = Main.maxTilesY / 2;
46 short[] array = new short[width];
47 for (int i = startX; i < startX + width; i++)
48 {
49 bool flag = false;
50 int num2 = 0;
51 for (int j = 50; j < 50 + num; j++)
52 {
53 if (Main.tile[i, j].active())
54 {
55 if (Main.tile[i, j].type == 189 || Main.tile[i, j].type == 196 || Main.tile[i, j].type == 460)
56 {
57 flag = false;
58 }
59 else if (!flag)
60 {
61 num2 = j;
62 flag = true;
63 }
64 }
65 if (!flag)
66 {
67 num2 = num + 50;
68 }
69 }
70 array[i - startX] = (short)num2;
71 }
72 return new SurfaceMap(array, startX);
73 }

References Terraria.GameContent.Biomes.Desert.SurfaceMap.SurfaceMap(), System.array, and Terraria.Main.tile.

Referenced by Terraria.GameContent.Biomes.Desert.DesertDescription.CreateFromPlacement(), Terraria.GameContent.Biomes.DunesBiome.DunesDescription.CreateFromPlacement(), and Terraria.GameContent.Biomes.Desert.DesertDescription.UpdateSurfaceMap().