Skip to content

Commit

Permalink
allow enter moon if someone else is inside it
Browse files Browse the repository at this point in the history
  • Loading branch information
misternebula committed Feb 8, 2023
1 parent 4ce0c84 commit b4741c6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions QSB/QuantumSync/Patches/Common/QuantumMoonPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,16 @@ public static bool CheckPlayerFogProximity(QuantumMoon __instance)
{
var playersWhoCanSeeMoon = QuantumManager.IsVisibleUsingCameraFrustum((ShapeVisibilityTracker)__instance._visibilityTracker, true).PlayersWhoCanSee;
var shipInFog = GetShipInFog(__instance);
var anyoneInMoon = QSBPlayerManager.PlayerList.Any(x => x.IsInMoon && !x.IsLocalPlayer);

DebugLog.DebugWrite($"Inside Fog - shipInFog:{shipInFog} playersWhoCanSeeMoon.Count:{playersWhoCanSeeMoon.Count}, lockedByProbeSnapshot:{__instance.IsLockedByProbeSnapshot()}");

if (playersWhoCanSeeMoon.Any(x => !(shipInFog && x.IsInShip) && !GetTransformInFog(__instance, x.CameraBody.transform)) || __instance.IsLockedByProbeSnapshot())
// this probably breaks in really obscure cases, but it should be good enough...
if (playersWhoCanSeeMoon.Any(x => !(shipInFog && x.IsInShip) && !GetTransformInFog(__instance, x.CameraBody.transform)) || __instance.IsLockedByProbeSnapshot() || anyoneInMoon)
{
/* Either :
* - The moon is locked with a snapshot
* OR
* - Someone else is in the moon
* OR
* - If the ship is in the fog :
* - there are people outside the ship who can see the moon, and who are not in the fog
* - If the ship is not in the fog
Expand Down

0 comments on commit b4741c6

Please sign in to comment.