Files
Nitrox/NitroxPatcher/Patches/Dynamic/StasisSphere_Freeze_Patch.cs
2025-07-06 00:23:46 +02:00

20 lines
637 B
C#

using System.Reflection;
using NitroxClient.GameLogic.PlayerLogic;
using NitroxModel.Helper;
using UnityEngine;
namespace NitroxPatcher.Patches.Dynamic;
/// <summary>
/// Prevents remote players from being frozen by remote stasis fields
/// </summary>
public sealed partial class StasisSphere_Freeze_Patch : NitroxPatch, IDynamicPatch
{
private static readonly MethodInfo TARGET_METHOD = Reflect.Method((StasisSphere t) => t.Freeze(default, ref Reflect.Ref<Rigidbody>.Field));
public static bool Prefix(Collider other, ref bool __result)
{
return !other.GetComponentInParent<RemotePlayerIdentifier>(true);
}
}