first commit
This commit is contained in:
26
NitroxPatcher/Patches/Dynamic/PDAEncyclopedia_Add_Patch.cs
Normal file
26
NitroxPatcher/Patches/Dynamic/PDAEncyclopedia_Add_Patch.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.Reflection;
|
||||
using NitroxClient.Communication.Abstract;
|
||||
using NitroxClient.MonoBehaviours;
|
||||
using NitroxModel.Helper;
|
||||
using NitroxModel.Packets;
|
||||
|
||||
namespace NitroxPatcher.Patches.Dynamic;
|
||||
|
||||
public sealed partial class PDAEncyclopedia_Add_Patch : NitroxPatch, IDynamicPatch
|
||||
{
|
||||
private static readonly MethodInfo TARGET_METHOD = Reflect.Method(() => PDAEncyclopedia.Add(default, default, default));
|
||||
|
||||
public static void Postfix(string key, bool verbose, PDAEncyclopedia.EntryData __result)
|
||||
{
|
||||
if (!Multiplayer.Main || !Multiplayer.Main.InitialSyncCompleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Is null when it's a duplicate call
|
||||
if (__result != null)
|
||||
{
|
||||
Resolve<IPacketSender>().Send(new PDAEncyclopediaEntryAdd(key, verbose));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user