diff --git a/NewHorizons/Builder/Body/HeightMapBuilder.cs b/NewHorizons/Builder/Body/HeightMapBuilder.cs index ffa6e87c..6be4d83f 100644 --- a/NewHorizons/Builder/Body/HeightMapBuilder.cs +++ b/NewHorizons/Builder/Body/HeightMapBuilder.cs @@ -5,6 +5,7 @@ using NewHorizons.Handlers; using NewHorizons.Utility; using OWML.Common; using System; +using System.IO; using UnityEngine; using Logger = NewHorizons.Utility.Logger; namespace NewHorizons.Builder.Body @@ -20,6 +21,17 @@ namespace NewHorizons.Builder.Body Texture2D heightMap, textureMap; try { + if (!File.Exists(Path.Combine(mod.ModHelper.Manifest.ModFolderPath, module.heightMap ?? ""))) + { + Logger.LogError($"Bad path for {planetGO.name} heightMap: {module.heightMap} couldn't be found."); + module.heightMap = null; + } + if (!File.Exists(Path.Combine(mod.ModHelper.Manifest.ModFolderPath, module.textureMap ?? ""))) + { + Logger.LogError($"Bad path for {planetGO.name} textureMap: {module.textureMap} couldn't be found."); + module.textureMap = null; + } + if (module.heightMap == null) { heightMap = Texture2D.whiteTexture;