allow enter moon if someone else is inside it

This commit is contained in:
_nebula 2023-02-08 12:16:12 +00:00
parent 4ce0c844a1
commit b4741c6f1b

View File

@ -30,14 +30,16 @@ internal class QuantumMoonPatches : QSBPatch
{ {
var playersWhoCanSeeMoon = QuantumManager.IsVisibleUsingCameraFrustum((ShapeVisibilityTracker)__instance._visibilityTracker, true).PlayersWhoCanSee; var playersWhoCanSeeMoon = QuantumManager.IsVisibleUsingCameraFrustum((ShapeVisibilityTracker)__instance._visibilityTracker, true).PlayersWhoCanSee;
var shipInFog = GetShipInFog(__instance); 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()}"); // 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)
if (playersWhoCanSeeMoon.Any(x => !(shipInFog && x.IsInShip) && !GetTransformInFog(__instance, x.CameraBody.transform)) || __instance.IsLockedByProbeSnapshot())
{ {
/* Either : /* Either :
* - The moon is locked with a snapshot * - The moon is locked with a snapshot
* OR * OR
* - Someone else is in the moon
* OR
* - If the ship is in the fog : * - 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 * - 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 * - If the ship is not in the fog