Skip to content

Commit

Permalink
Fix malfunctions
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed May 15, 2024
1 parent 9facf63 commit cd8b035
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ItemFactory>.Instance.CreateItem(MongoID.Generate(), packet.ShotInfoPacket.AmmoTemplate, null);
if (weaponPrefab != null)
{
Expand Down

0 comments on commit cd8b035

Please sign in to comment.