Skip to content

Commit

Permalink
If a black hole isn't paired right don't give up on all others
Browse files Browse the repository at this point in the history
  • Loading branch information
xen-42 committed Aug 12, 2023
1 parent d926e0d commit 9536c3d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions NewHorizons/Builder/Body/SingularityBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,24 +113,24 @@ public static void PairAllSingularities()
if (!_singularitiesByID.TryGetValue(blackHoleID, out GameObject blackHole))
{
NHLogger.LogWarning($"Black hole [{blackHoleID}] is missing.");
break;
continue;
}
if (!_singularitiesByID.TryGetValue(whiteHoleID, out GameObject whiteHole))
{
NHLogger.LogWarning($"White hole [{whiteHoleID}] is missing.");
break;
continue;
}
var whiteHoleVolume = whiteHole.GetComponentInChildren<WhiteHoleVolume>();
var blackHoleVolume = blackHole.GetComponentInChildren<BlackHoleVolume>();
if (whiteHoleVolume == null || blackHoleVolume == null)
{
NHLogger.LogWarning($"Singularities [{blackHoleID}] and [{whiteHoleID}] do not have compatible polarities.");
break;
continue;
}
if (blackHoleVolume._whiteHole != null && blackHoleVolume._whiteHole != whiteHoleVolume)
{
NHLogger.LogWarning($"Black hole [{blackHoleID}] has already been linked!");
break;
continue;
}
NHLogger.LogVerbose($"Pairing singularities [{blackHoleID}], [{whiteHoleID}]");
blackHoleVolume._whiteHole = whiteHoleVolume;
Expand Down

0 comments on commit 9536c3d

Please sign in to comment.