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

◆ SmoothTrack()

void Terraria.GameContent.Generation.TrackGenerator.SmoothTrack ( )
inlineprivate

Definition at line 333 of file TrackGenerator.cs.

334 {
335 int num = _length - 1;
336 bool flag = false;
337 for (int num2 = _length - 1; num2 >= 0; num2--)
338 {
339 if (flag)
340 {
341 num = Math.Min(num2 + 15, num);
342 if (_history[num2].Y >= _history[num].Y)
343 {
344 for (int i = num2 + 1; _history[i].Y > _history[num2].Y; i++)
345 {
346 _history[i].Y = _history[num2].Y;
347 _history[i].Slope = TrackSlope.Straight;
348 }
349 if (_history[num2].Y == _history[num].Y)
350 {
351 flag = false;
352 }
353 }
354 }
355 else if (_history[num2].Y > _history[num].Y)
356 {
357 flag = true;
358 }
359 else
360 {
361 num = num2;
362 }
363 }
364 }
static byte Min(byte val1, byte val2)
Definition Math.cs:912

References Terraria.GameContent.Generation.TrackGenerator._history, Terraria.GameContent.Generation.TrackGenerator._length, System.Math.Min(), Terraria.GameContent.Generation.TrackGenerator.TrackHistory.Slope, System.Y, and Terraria.GameContent.Generation.TrackGenerator.TrackHistory.Y.

Referenced by Terraria.GameContent.Generation.TrackGenerator.FindPath().