mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Throw error when making signal without name or frequency #660
This commit is contained in:
parent
4565e50d37
commit
53f7bc0b67
@ -5,6 +5,7 @@ using NewHorizons.Utility.OWML;
|
|||||||
using OWML.Common;
|
using OWML.Common;
|
||||||
using OWML.Utils;
|
using OWML.Utils;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.SceneManagement;
|
using UnityEngine.SceneManagement;
|
||||||
@ -134,6 +135,9 @@ namespace NewHorizons.Builder.Props.Audio
|
|||||||
|
|
||||||
public static GameObject Make(GameObject planetGO, Sector sector, SignalInfo info, IModBehaviour mod)
|
public static GameObject Make(GameObject planetGO, Sector sector, SignalInfo info, IModBehaviour mod)
|
||||||
{
|
{
|
||||||
|
if (string.IsNullOrEmpty(info.frequency)) throw new System.Exception("Cannot make a signal without a frequency");
|
||||||
|
if (string.IsNullOrEmpty(info.name)) throw new System.Exception("Cannot make a signal without a name");
|
||||||
|
|
||||||
var owAudioSource = GeneralAudioBuilder.Make(planetGO, sector, info, mod);
|
var owAudioSource = GeneralAudioBuilder.Make(planetGO, sector, info, mod);
|
||||||
var signalGO = owAudioSource.gameObject;
|
var signalGO = owAudioSource.gameObject;
|
||||||
|
|
||||||
|
|||||||
@ -225,7 +225,14 @@ namespace NewHorizons.Builder.Props
|
|||||||
{
|
{
|
||||||
foreach (var signal in config.Props.signals)
|
foreach (var signal in config.Props.signals)
|
||||||
{
|
{
|
||||||
SignalBuilder.Make(go, sector, signal, mod);
|
try
|
||||||
|
{
|
||||||
|
SignalBuilder.Make(go, sector, signal, mod);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
NHLogger.LogError($"Couldn't make signal on planet [{config.name}] - {ex}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (config.Props.remotes != null)
|
if (config.Props.remotes != null)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user