first commit

This commit is contained in:
2025-07-06 00:23:46 +02:00
commit 38f50c8819
1788 changed files with 112878 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
using System.Reflection;
using NitroxClient.GameLogic.PlayerLogic;
using NitroxClient.Unity.Helper;
using NitroxModel.Helper;
using UnityEngine;
namespace NitroxPatcher.Patches.Dynamic;
/// <summary>
/// When looking for an EntityRoot, we want to make sure that remote players can be recognized as one.
/// </summary>
public sealed partial class Utils_GetEntityRoot_Patch : NitroxPatch, IDynamicPatch
{
private static readonly MethodInfo TARGET_METHOD = Reflect.Method(() => UWE.Utils.GetEntityRoot(default));
public static bool Prefix(GameObject go, ref GameObject __result)
{
if (go.TryGetComponent(out RemotePlayerIdentifier remotePlayerIdentifier) ||
go.TryGetComponentInParent(out remotePlayerIdentifier, true))
{
__result = remotePlayerIdentifier.gameObject;
return false;
}
return true;
}
}