diff --git a/project/code/Mission.cs b/project/code/Mission.cs index 48b3d0b..bea09a7 100644 --- a/project/code/Mission.cs +++ b/project/code/Mission.cs @@ -371,6 +371,7 @@ public partial class Mission : Node3D private void LoadTextures(TxList textureList) { // TODO: This has hardcoded .png extension and relies on you placing extracted and converted images in godot user directory + // TODO: Use PathJoin var count = textureList.ItemCount; for (var i = 0; i < count; i++) { @@ -388,9 +389,11 @@ public partial class Mission : Node3D } path += item.Name + ".png"; // Hardcoded extension! - if (File.Exists(FileName + path)) + // TODO: It's case sensitive :) + var fmFamPath = Path.GetDirectoryName(FileName).PathJoin(path); + if (File.Exists(fmFamPath)) { - path = FileName + path; + path = fmFamPath; } else if (File.Exists(ProjectSettings.GlobalizePath($"user://textures{path}"))) { @@ -398,6 +401,7 @@ public partial class Mission : Node3D } else { + GD.Print($"Failed to find texture: {path}"); path = "user://textures/jorge.png"; }