Skip to content

Commit

Permalink
Fix drawing biome map when none present
Browse files Browse the repository at this point in the history
  • Loading branch information
DMagic1 committed Aug 15, 2020
1 parent d4be860 commit e2c906b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion SCANsat/SCAN_Unity/SCAN_UI_MainMap.cs
Expand Up @@ -88,6 +88,12 @@ public void OnDestroy()
MonoBehaviour.Destroy(uiElement.gameObject);
}

if (map_small != null)
{
GameObject.Destroy(map_small);
map_small = null;
}

GameEvents.onVesselSOIChanged.Remove(soiChange);
GameEvents.onVesselChange.Remove(vesselChange);
GameEvents.onVesselWasModified.Remove(vesselChange);
Expand Down Expand Up @@ -769,7 +775,7 @@ private void drawBiomeMap(SCANtype type, bool apply)
{
bool biomeMap = data.Body.BiomeMap != null;

if (biomeBuilding)
if (biomeBuilding && biomeMap)
buildBiomeCache();

if (scanline == 0 && TerminatorToggle)
Expand Down

0 comments on commit e2c906b

Please sign in to comment.