diff --git a/Fika.Core/Coop/ClientClasses/HandsControllers/CoopClientFirearmController.cs b/Fika.Core/Coop/ClientClasses/HandsControllers/CoopClientFirearmController.cs index bd2b947b..f15ea5f6 100644 --- a/Fika.Core/Coop/ClientClasses/HandsControllers/CoopClientFirearmController.cs +++ b/Fika.Core/Coop/ClientClasses/HandsControllers/CoopClientFirearmController.cs @@ -446,7 +446,8 @@ public override void ShotMisfired(BulletClass ammo, Weapon.EMalfunctionState mal IsPrimaryActive = true, ShotType = shotType, AmmoAfterShot = Item.GetCurrentMagazineCount(), - Overheat = overheat + Overheat = overheat, + AmmoTemplate = ammo.TemplateId } }); diff --git a/Fika.Core/Coop/ObservedClasses/HandsControllers/CoopObservedFirearmController.cs b/Fika.Core/Coop/ObservedClasses/HandsControllers/CoopObservedFirearmController.cs index 3c5495b8..2fd070bc 100644 --- a/Fika.Core/Coop/ObservedClasses/HandsControllers/CoopObservedFirearmController.cs +++ b/Fika.Core/Coop/ObservedClasses/HandsControllers/CoopObservedFirearmController.cs @@ -197,6 +197,12 @@ public void HandleFirearmPacket(in WeaponPacket packet, InventoryControllerClass break; } + if (string.IsNullOrEmpty(packet.ShotInfoPacket.AmmoTemplate)) + { + FikaPlugin.Instance.FikaLogger.LogError("CoopObservedFirearmController::HandleFirearmPacket: AmmoTemplate was null or empty!"); + return; + } + Weapon.MalfState.MalfunctionedAmmo = (BulletClass)Singleton.Instance.CreateItem(MongoID.Generate(), packet.ShotInfoPacket.AmmoTemplate, null); if (weaponPrefab != null) {