mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
If texture/heightmap files don't exist, do error
This commit is contained in:
parent
86069d54ca
commit
7c5511d5f9
@ -5,6 +5,7 @@ using NewHorizons.Handlers;
|
|||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using OWML.Common;
|
using OWML.Common;
|
||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Logger = NewHorizons.Utility.Logger;
|
using Logger = NewHorizons.Utility.Logger;
|
||||||
namespace NewHorizons.Builder.Body
|
namespace NewHorizons.Builder.Body
|
||||||
@ -20,6 +21,17 @@ namespace NewHorizons.Builder.Body
|
|||||||
Texture2D heightMap, textureMap;
|
Texture2D heightMap, textureMap;
|
||||||
try
|
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)
|
if (module.heightMap == null)
|
||||||
{
|
{
|
||||||
heightMap = Texture2D.whiteTexture;
|
heightMap = Texture2D.whiteTexture;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user