diff --git a/Fika.Core/Coop/ClientClasses/HandsControllers/CoopClientGrenadeController.cs b/Fika.Core/Coop/ClientClasses/HandsControllers/CoopClientGrenadeController.cs index 86c31603..030c24d6 100644 --- a/Fika.Core/Coop/ClientClasses/HandsControllers/CoopClientGrenadeController.cs +++ b/Fika.Core/Coop/ClientClasses/HandsControllers/CoopClientGrenadeController.cs @@ -138,6 +138,7 @@ public override void ChangeFireMode(Weapon.EFireMode fireMode) return; } + // Check for GClass increments Class1111 currentOperation = CurrentOperation; if (currentOperation != null) { diff --git a/Fika.Core/Coop/HostClasses/CoopHostGameWorld.cs b/Fika.Core/Coop/HostClasses/CoopHostGameWorld.cs index 29361d88..808db7b6 100644 --- a/Fika.Core/Coop/HostClasses/CoopHostGameWorld.cs +++ b/Fika.Core/Coop/HostClasses/CoopHostGameWorld.cs @@ -2,7 +2,6 @@ using EFT; using EFT.InventoryLogic; using EFT.SynchronizableObjects; -using Fika.Core.Coop.HostClasses; using Fika.Core.Coop.Utils; using Fika.Core.Networking; using HarmonyLib; @@ -13,7 +12,7 @@ using System.Threading.Tasks; using UnityEngine; -namespace Fika.Core.Coop.ClientClasses +namespace Fika.Core.Coop.HostClasses { /// /// used in Fika for hosts to override methods and logic @@ -95,6 +94,15 @@ public override void InitAirdrop(string lootTemplateId = null, bool takeNearbyPo ClientSynchronizableObjectLogicProcessor.InitSyncObject(synchronizableObject, gameObject.transform.position, Vector3.forward, -1); } + public override GClass2329 SyncObjectProcessorFactory() + { + ClientSynchronizableObjectLogicProcessor = new SynchronizableObjectLogicProcessorClass + { + TripwireManager = new(Singleton.Instance) + }; + return ClientSynchronizableObjectLogicProcessor; + } + public override void PlantTripwire(Item item, string profileId, Vector3 fromPosition, Vector3 toPosition) { if (item is not GrenadeClass grenadeClass) @@ -102,6 +110,12 @@ public override void PlantTripwire(Item item, string profileId, Vector3 fromPosi return; } + if (SynchronizableObjectLogicProcessor.TripwireManager == null) + { + FikaPlugin.Instance.FikaLogger.LogError("TripwireManager was null! Creating new..."); + SynchronizableObjectLogicProcessor.TripwireManager = new GClass2331(this); + } + TripwireSynchronizableObject tripwireSynchronizableObject = (TripwireSynchronizableObject)SynchronizableObjectLogicProcessor.TakeFromPool(SynchronizableObjectType.Tripwire); tripwireSynchronizableObject.transform.SetPositionAndRotation(fromPosition, Quaternion.identity); SynchronizableObjectLogicProcessor.InitSyncObject(tripwireSynchronizableObject, fromPosition, Vector3.forward, -1); diff --git a/Fika.Core/Coop/Patches/GameWorld/GameWorld_Create_Patch.cs b/Fika.Core/Coop/Patches/GameWorld/GameWorld_Create_Patch.cs index 9ba991e9..5f88888b 100644 --- a/Fika.Core/Coop/Patches/GameWorld/GameWorld_Create_Patch.cs +++ b/Fika.Core/Coop/Patches/GameWorld/GameWorld_Create_Patch.cs @@ -1,5 +1,6 @@ using EFT; using Fika.Core.Coop.ClientClasses; +using Fika.Core.Coop.HostClasses; using Fika.Core.Coop.Utils; using HarmonyLib; using SPT.Reflection.Patching; diff --git a/Fika.Core/Networking/Packets/FirearmController/FirearmSubPackets.cs b/Fika.Core/Networking/Packets/FirearmController/FirearmSubPackets.cs index 8ad70152..505e752e 100644 --- a/Fika.Core/Networking/Packets/FirearmController/FirearmSubPackets.cs +++ b/Fika.Core/Networking/Packets/FirearmController/FirearmSubPackets.cs @@ -3,6 +3,7 @@ using EFT.InventoryLogic; using Fika.Core.Coop.ObservedClasses; using Fika.Core.Coop.Players; +using Fika.Core.Coop.Utils; using LiteNetLib.Utils; using System; using System.Collections.Generic;