-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix fishes (and leviathans) movement
- Loading branch information
1 parent
52f20eb
commit ad49f35
Showing
2 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
NitroxPatcher/Patches/Dynamic/SwimBehaviour_ManagedUpdate_Patch.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Reflection; | ||
using NitroxClient.MonoBehaviours; | ||
using NitroxModel.Helper; | ||
|
||
namespace NitroxPatcher.Patches.Dynamic; | ||
|
||
/// <summary> | ||
/// Prevents <see cref="SwimBehaviour.ManagedUpdate"/> from happening on remotely controlled fishes (so their remote trajectory isn not modified) | ||
/// </summary> | ||
public sealed partial class SwimBehaviour_ManagedUpdate_Patch : NitroxPatch, IDynamicPatch | ||
{ | ||
private static readonly MethodInfo TARGET_METHOD = Reflect.Method((SwimBehaviour t) => t.ManagedUpdate()); | ||
|
||
public static bool Prefix(SwimBehaviour __instance) | ||
{ | ||
return !__instance.GetComponent<RemotelyControlled>(); | ||
} | ||
} |