Skip to content

Commit da047f1

Browse files
committed
Fix for default texture being added multiple times in Textures list
1 parent eb99b75 commit da047f1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Source/RunActivity/Viewer3D/Materials.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@
1717

1818
// This file is the responsibility of the 3D & Environment Team.
1919

20-
using Microsoft.Xna.Framework;
21-
using Microsoft.Xna.Framework.Graphics;
22-
using Orts.Viewer3D.Common;
23-
using Orts.Viewer3D.Popups;
24-
using ORTS.Common;
2520
using System;
2621
using System.Collections.Generic;
2722
using System.Diagnostics;
2823
using System.IO;
2924
using System.Linq;
3025
using System.Threading;
26+
using Microsoft.Xna.Framework;
27+
using Microsoft.Xna.Framework.Graphics;
28+
using Orts.Viewer3D.Common;
29+
using Orts.Viewer3D.Popups;
30+
using ORTS.Common;
3131

3232
namespace Orts.Viewer3D
3333
{
@@ -81,7 +81,7 @@ public Texture2D Get(string path, Texture2D defaultTexture, bool required = fals
8181
texture = Orts.Formats.Msts.AceFile.Texture2DFromFile(GraphicsDevice, aceTexture);
8282
Trace.TraceWarning("Required texture {1} not existing; using existing texture {2}", path, aceTexture);
8383
}
84-
else texture = defaultTexture;
84+
else return defaultTexture;
8585
}
8686
}
8787
else if (Path.GetExtension(path) == ".ace")

0 commit comments

Comments
 (0)