SRMP-Public/SRMP/Patches/Patch_PlaceGadgetUI.cs
2023-05-29 22:23:11 +02:00

27 lines
677 B
C#

using HarmonyLib;
using SRMultiplayer.Packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SRMultiplayer.Patches
{
[HarmonyPatch(typeof(PlaceGadgetUI))]
[HarmonyPatch("Place")]
class PlaceGadgetUI_Place
{
static void Postfix(PlaceGadgetUI __instance, Gadget.Id id)
{
if (!Globals.IsMultiplayer) return;
new PacketGadgetSpawn()
{
ID = __instance.site.id,
Ident = (ushort)id,
Rotation = __instance.site.attached.transform.eulerAngles.y
}.Send();
}
}
}