SRMP-Public/SRMP/Patches/Patch_ScorePlort.cs

24 lines
630 B
C#
Raw Permalink Normal View History

2023-05-29 22:23:11 +02:00
using HarmonyLib;
using SRMultiplayer.Networking;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace SRMultiplayer.Patches
{
[HarmonyPatch(typeof(ScorePlort))]
[HarmonyPatch("OnTriggerEnter")]
class ScorePlort_OnTriggerEnter
{
static bool Prefix(ScorePlort __instance, Collider col)
{
if (!Globals.IsMultiplayer || Globals.HandlePacket) return true;
var netActor = col.GetComponent<NetworkActor>();
return (netActor != null && netActor.IsLocal);
}
}
}