mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-03-08 19:14:12 +00:00
use "out * __result" instead of "ref * __result" where we can
This commit is contained in:
parent
2a1e108a80
commit
1088603538
@ -14,7 +14,7 @@ namespace QSB.Anglerfish.Patches
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(AnglerfishController), nameof(AnglerfishController.GetTargetPosition))]
|
||||
public static bool GetTargetPosition(AnglerfishController __instance, ref Vector3 __result)
|
||||
public static bool GetTargetPosition(AnglerfishController __instance, out Vector3 __result)
|
||||
{
|
||||
var qsbAngler = __instance.GetWorldObject<QSBAngler>();
|
||||
|
||||
|
@ -97,7 +97,7 @@ namespace QSB.ConversationSync.Patches
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(RemoteDialogueTrigger), nameof(RemoteDialogueTrigger.ConversationTriggered))]
|
||||
public static bool ConversationTriggeredReplacement(RemoteDialogueTrigger __instance, ref bool __result, out RemoteDialogueTrigger.RemoteDialogueCondition dialogue)
|
||||
public static bool ConversationTriggeredReplacement(RemoteDialogueTrigger __instance, out bool __result, out RemoteDialogueTrigger.RemoteDialogueCondition dialogue)
|
||||
{
|
||||
dialogue = default;
|
||||
var dialogueIndex = -1;
|
||||
|
@ -24,7 +24,7 @@ namespace QSB.DeathSync.Patches
|
||||
// TODO : Remove with future functionality.
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ShipDetachableLeg), nameof(ShipDetachableLeg.Detach))]
|
||||
public static bool ShipDetachableLeg_Detach(ref OWRigidbody __result)
|
||||
public static bool ShipDetachableLeg_Detach(out OWRigidbody __result)
|
||||
{
|
||||
__result = null;
|
||||
return false;
|
||||
@ -33,7 +33,7 @@ namespace QSB.DeathSync.Patches
|
||||
// TODO : Remove with future functionality.
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ShipDetachableModule), nameof(ShipDetachableModule.Detach))]
|
||||
public static bool ShipDetachableModule_Detach(ref OWRigidbody __result)
|
||||
public static bool ShipDetachableModule_Detach(out OWRigidbody __result)
|
||||
{
|
||||
__result = null;
|
||||
return false;
|
||||
|
@ -15,7 +15,7 @@ namespace QSB.EyeOfTheUniverse.ForestOfGalaxies.Patches
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(OldGrowthForestController), nameof(OldGrowthForestController.CheckIllumination))]
|
||||
public static bool CheckIlluminationReplacement(Vector3 worldPosition, ref bool __result)
|
||||
public static bool CheckIlluminationReplacement(Vector3 worldPosition, out bool __result)
|
||||
{
|
||||
if (Locator.GetFlashlight().IsFlashlightOn() || QSBPlayerManager.PlayerList.Any(x => x.FlashlightActive))
|
||||
{
|
||||
|
@ -20,7 +20,7 @@ namespace QSB.QuantumSync.Patches
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(QuantumObject), nameof(QuantumObject.IsLockedByPlayerContact))]
|
||||
public static bool QuantumObject_IsLockedByPlayerContact(ref bool __result, QuantumObject __instance)
|
||||
public static bool QuantumObject_IsLockedByPlayerContact(out bool __result, QuantumObject __instance)
|
||||
{
|
||||
var playersEntangled = QuantumManager.GetEntangledPlayers(__instance);
|
||||
__result = playersEntangled.Count() != 0 && __instance.IsIlluminated();
|
||||
@ -308,7 +308,7 @@ namespace QSB.QuantumSync.Patches
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(QuantumShrine), nameof(QuantumShrine.IsPlayerInDarkness))]
|
||||
public static bool QuantumShrine_IsPlayerInDarkness(QuantumShrine __instance, ref bool __result)
|
||||
public static bool QuantumShrine_IsPlayerInDarkness(QuantumShrine __instance, out bool __result)
|
||||
{
|
||||
foreach (var lamp in __instance._lamps)
|
||||
{
|
||||
|
@ -26,7 +26,7 @@ namespace QSB.QuantumSync.Patches
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ShapeVisibilityTracker), nameof(ShapeVisibilityTracker.IsVisibleUsingCameraFrustum))]
|
||||
public static bool ShapeVisibilityTracker_IsVisibleUsingCameraFrustum(ShapeVisibilityTracker __instance, ref bool __result)
|
||||
public static bool ShapeVisibilityTracker_IsVisibleUsingCameraFrustum(ShapeVisibilityTracker __instance, out bool __result)
|
||||
{
|
||||
__result = QuantumManager.IsVisibleUsingCameraFrustum(__instance, false).Item1;
|
||||
return false;
|
||||
@ -34,7 +34,7 @@ namespace QSB.QuantumSync.Patches
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ShapeVisibilityTracker), nameof(ShapeVisibilityTracker.IsVisible))]
|
||||
public static bool ShapeVisibilityTracker_IsVisible(ShapeVisibilityTracker __instance, ref bool __result)
|
||||
public static bool ShapeVisibilityTracker_IsVisible(ShapeVisibilityTracker __instance, out bool __result)
|
||||
{
|
||||
__result = QuantumManager.IsVisible(__instance, false);
|
||||
return false;
|
||||
@ -44,7 +44,7 @@ namespace QSB.QuantumSync.Patches
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(RendererVisibilityTracker), nameof(RendererVisibilityTracker.IsVisibleUsingCameraFrustum))]
|
||||
public static bool RendererVisibilityTracker_IsVisibleUsingCameraFrustum(RendererVisibilityTracker __instance, ref bool __result)
|
||||
public static bool RendererVisibilityTracker_IsVisibleUsingCameraFrustum(RendererVisibilityTracker __instance, out bool __result)
|
||||
{
|
||||
__result = QSBPlayerManager.GetPlayersWithCameras()
|
||||
.Any(x => GeometryUtility.TestPlanesAABB(x.Camera.GetFrustumPlanes(), __instance._renderer.bounds))
|
||||
@ -57,7 +57,7 @@ namespace QSB.QuantumSync.Patches
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(VisibilityObject), nameof(VisibilityObject.CheckIllumination))]
|
||||
public static bool VisibilityObject_CheckIllumination(VisibilityObject __instance, ref bool __result)
|
||||
public static bool VisibilityObject_CheckIllumination(VisibilityObject __instance, out bool __result)
|
||||
{
|
||||
if (!__instance._checkIllumination)
|
||||
{
|
||||
|
@ -59,7 +59,7 @@ namespace QSB.QuantumSync.Patches
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(QuantumMoon), nameof(QuantumMoon.ChangeQuantumState))]
|
||||
public static bool ChangeQuantumState(QuantumMoon __instance, bool skipInstantVisibilityCheck, ref bool __result)
|
||||
public static bool ChangeQuantumState(QuantumMoon __instance, bool skipInstantVisibilityCheck, out bool __result)
|
||||
{
|
||||
var foundNewPosition = false;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user