From be5ff1eb5f051bc784efa6f5acd64f420503e108 Mon Sep 17 00:00:00 2001 From: Archangel Date: Thu, 14 Nov 2024 13:37:32 +0100 Subject: [PATCH] Update comments --- .../HandsControllers/CoopObservedFirearmController.cs | 2 -- .../Coop/ObservedClasses/ObservedInventoryController.cs | 5 ++++- .../Packets/FirearmController/FirearmSubPackets.cs | 3 +-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Fika.Core/Coop/ObservedClasses/HandsControllers/CoopObservedFirearmController.cs b/Fika.Core/Coop/ObservedClasses/HandsControllers/CoopObservedFirearmController.cs index 96953e5b..2a17f102 100644 --- a/Fika.Core/Coop/ObservedClasses/HandsControllers/CoopObservedFirearmController.cs +++ b/Fika.Core/Coop/ObservedClasses/HandsControllers/CoopObservedFirearmController.cs @@ -468,7 +468,6 @@ private void HandleObservedShot(ref ShotInfoPacket packet, InventoryController i } } - // Check for GClass increments if (Weapon is RevolverItemClass) { Weapon.CylinderHammerClosed = Weapon.FireMode.FireMode == Weapon.EFireMode.doubleaction; @@ -573,7 +572,6 @@ private void HandleShellEvent(WeaponManagerClass weaponEffectsManager, ref ShotI FirearmsAnimator.SetBoltCatch(true); } - //Check for GClass increments if (Weapon is RevolverItemClass || Weapon.ReloadMode == Weapon.EReloadMode.OnlyBarrel || boltAction) { return; diff --git a/Fika.Core/Coop/ObservedClasses/ObservedInventoryController.cs b/Fika.Core/Coop/ObservedClasses/ObservedInventoryController.cs index cf753ddc..4841e34f 100644 --- a/Fika.Core/Coop/ObservedClasses/ObservedInventoryController.cs +++ b/Fika.Core/Coop/ObservedClasses/ObservedInventoryController.cs @@ -137,12 +137,13 @@ private void HandleInProcess(Item item, ItemAddress to, GInterface400 operation, player_0 = coopPlayer, callback = callback }; + if (!coopPlayer.HealthController.IsAlive) { handler.callback.Succeed(); return; } - // Check for GClass increments, fold operation + if ((item.Parent != to || operation is FoldOperationClass) && handler.player_0.HandsController.CanExecute(operation)) { Traverse.Create(handler.player_0).Field("_setInHandsCallback").Value = handler.callback; @@ -150,11 +151,13 @@ private void HandleInProcess(Item item, ItemAddress to, GInterface400 operation, handler.player_0.HandsController.Execute(operation, new Callback(handler.method_1)); return; } + if (operation is FoldOperationClass && !handler.player_0.HandsController.CanExecute(operation)) { handler.callback.Fail("Can't perform operation"); return; } + handler.callback.Succeed(); } diff --git a/Fika.Core/Networking/Packets/FirearmController/FirearmSubPackets.cs b/Fika.Core/Networking/Packets/FirearmController/FirearmSubPackets.cs index 7f06159c..301b1341 100644 --- a/Fika.Core/Networking/Packets/FirearmController/FirearmSubPackets.cs +++ b/Fika.Core/Networking/Packets/FirearmController/FirearmSubPackets.cs @@ -216,7 +216,6 @@ public RollCylinderPacket(NetDataReader reader) public void Execute(CoopPlayer player) { - // Check for GClass increments if (player.HandsController is CoopObservedFirearmController controller && controller.Weapon is RevolverItemClass) { controller.RollCylinder(RollToZeroCamora); @@ -1024,7 +1023,7 @@ public void Execute(CoopPlayer player) if (StartOneShotFire) { controller.FirearmsAnimator.SetFire(true); - // Check for GClass increments + if (controller.Weapon is not RevolverItemClass) { controller.FirearmsAnimator.Animator.Play(controller.FirearmsAnimator.FullFireStateName, 1, 0f);