Don't even try to supernova if it is null

This commit is contained in:
Noah Pilarski 2022-08-26 23:31:46 -04:00
parent a1aa65dda8
commit f2dd6b04d2

View File

@ -370,6 +370,7 @@ namespace NewHorizons.Components.SizeControllers
public void StartSupernova() public void StartSupernova()
{ {
if (supernova == null) return;
if (_isSupernova) return; if (_isSupernova) return;
Logger.LogVerbose($"{gameObject.transform.root.name} started supernova"); Logger.LogVerbose($"{gameObject.transform.root.name} started supernova");
@ -393,7 +394,7 @@ namespace NewHorizons.Components.SizeControllers
Logger.LogVerbose($"{gameObject.transform.root.name} stopped supernova"); Logger.LogVerbose($"{gameObject.transform.root.name} stopped supernova");
SupernovaStop.Invoke(); SupernovaStop.Invoke();
supernova.Deactivate(); if (supernova != null) supernova.Deactivate();
_isSupernova = false; _isSupernova = false;
if (atmosphere != null) atmosphere.SetActive(true); if (atmosphere != null) atmosphere.SetActive(true);
if (destructionVolume != null) if (destructionVolume != null)