File tree Expand file tree Collapse file tree
NitroxPatcher/Patches/Dynamic Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ using System . Reflection ;
2+ using NitroxClient . GameLogic ;
3+ using NitroxModel . DataStructures ;
4+
5+ namespace NitroxPatcher . Patches . Dynamic ;
6+
7+ /// <summary>
8+ /// Ensures vehicle charging from modules only occurs on the simulating player.
9+ /// </summary>
10+ public sealed partial class Vehicle_AddEnergy_Patch : NitroxPatch , IDynamicPatch
11+ {
12+ private static readonly MethodInfo TARGET_METHOD = Reflect . Method ( ( Vehicle t ) => t . AddEnergy ( default ) ) ;
13+
14+ public static bool Prefix ( Vehicle __instance )
15+ {
16+ return __instance . TryGetNitroxId ( out NitroxId vehicleId ) && Resolve < SimulationOwnership > ( ) . HasAnyLockType ( vehicleId ) ;
17+ }
18+ }
Original file line number Diff line number Diff line change 1+ using System . Reflection ;
2+ using NitroxClient . GameLogic ;
3+ using NitroxModel . DataStructures ;
4+
5+ namespace NitroxPatcher . Patches . Dynamic ;
6+
7+ /// <summary>
8+ /// Ensures vehicle charging from moonpool only occurs on the simulating player.
9+ /// </summary>
10+ public sealed partial class Vehicle_UpdateEnergyRecharge_Patch : NitroxPatch , IDynamicPatch
11+ {
12+ private static readonly MethodInfo TARGET_METHOD = Reflect . Method ( ( Vehicle t ) => t . UpdateEnergyRecharge ( ) ) ;
13+
14+ public static bool Prefix ( Vehicle __instance )
15+ {
16+ return __instance . TryGetNitroxId ( out NitroxId vehicleId ) && Resolve < SimulationOwnership > ( ) . HasAnyLockType ( vehicleId ) ;
17+ }
18+ }
You can’t perform that action at this time.
0 commit comments