mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-03-10 16:14:45 +00:00
make da thrusters work
This commit is contained in:
parent
350fc7e2ed
commit
39cdc960da
@ -94,6 +94,8 @@ public class PlayerInfo
|
||||
}
|
||||
private GameObject _body;
|
||||
|
||||
public ThrusterLightTracker ThrusterLightTracker;
|
||||
|
||||
public GameObject RoastingStick { get; set; }
|
||||
|
||||
// Tools
|
||||
|
@ -89,7 +89,10 @@ public static class QSBPlayerManager
|
||||
=> (Locator.GetFlashlight(), PlayerList.Where(x => x.FlashLight != null).Select(x => x.FlashLight));
|
||||
|
||||
public static (SurveyorProbe LocalProbe, IEnumerable<QSBProbe> RemoteProbes) GetPlayerProbes()
|
||||
=> new(Locator.GetProbe(), PlayerList.Where(x => x.Probe != null).Select(x => x.Probe));
|
||||
=> (Locator.GetProbe(), PlayerList.Where(x => x.Probe != null).Select(x => x.Probe));
|
||||
|
||||
public static IEnumerable<ThrusterLightTracker> GetThrusterLightTrackers()
|
||||
=> PlayerList.Select(x => x.ThrusterLightTracker).Where(x => x != null);
|
||||
|
||||
public static void ShowAllPlayers()
|
||||
=> PlayerList.ForEach(x => x.SetVisible(true, 2));
|
||||
|
@ -29,6 +29,7 @@ public static class LocalPlayerCreation
|
||||
var playerModel = playerBody.Find("Traveller_HEA_Player_v2");
|
||||
player.AnimationSync.InitLocal(playerModel);
|
||||
player.Body = playerBody.gameObject;
|
||||
player.ThrusterLightTracker = player.Body.GetComponentInChildren<ThrusterLightTracker>();
|
||||
|
||||
// camera
|
||||
var cameraBody = Locator.GetPlayerCamera().gameObject.transform;
|
||||
|
@ -53,6 +53,7 @@ public static class RemotePlayerCreation
|
||||
DebugLog.DebugWrite($"SET UP PLAYER BODY");
|
||||
|
||||
player.Body = REMOTE_Player_Body;
|
||||
player.ThrusterLightTracker = player.Body.GetComponentInChildren<ThrusterLightTracker>();
|
||||
|
||||
player.AnimationSync.InitRemote(REMOTE_Traveller_HEA_Player_v2.transform);
|
||||
|
||||
|
@ -68,8 +68,6 @@ public class QuantumVisibilityPatches : QSBPatch
|
||||
var point = __instance.transform.TransformPoint(__instance._localIlluminationOffset);
|
||||
var (localFlashlight, playerFlashlights) = QSBPlayerManager.GetPlayerFlashlights();
|
||||
|
||||
var (localProbe, playerProbes) = QSBPlayerManager.GetPlayerProbes();
|
||||
|
||||
if (localFlashlight.CheckIlluminationAtPoint(point, __instance._illuminationRadius))
|
||||
{
|
||||
__result = true;
|
||||
@ -82,6 +80,8 @@ public class QuantumVisibilityPatches : QSBPatch
|
||||
return false;
|
||||
}
|
||||
|
||||
var (localProbe, playerProbes) = QSBPlayerManager.GetPlayerProbes();
|
||||
|
||||
if (localProbe != null
|
||||
&& localProbe.IsLaunched()
|
||||
&& localProbe.CheckIlluminationAtPoint(point, __instance._illuminationRadius))
|
||||
@ -97,7 +97,8 @@ public class QuantumVisibilityPatches : QSBPatch
|
||||
}
|
||||
|
||||
// BUG : Implement checking for other player's thrusters!
|
||||
if (Locator.GetThrusterLightTracker().CheckIlluminationAtPoint(point, __instance._illuminationRadius))
|
||||
if (QSBPlayerManager.GetThrusterLightTrackers()
|
||||
.Any(x => x.CheckIlluminationAtPoint(point, __instance._illuminationRadius)))
|
||||
{
|
||||
__result = true;
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user