Skip to content

Commit

Permalink
fix: impossible to reload a weapon if all bullets run before
Browse files Browse the repository at this point in the history
  • Loading branch information
alexomur committed Dec 28, 2024
1 parent cff6004 commit 5d8ec2b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions InfinityAmmo/EventHandlers.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using System;
using Exiled.API.Enums;
using Exiled.API.Features;
using Exiled.API.Features.Pickups;
using Exiled.Events.EventArgs.Player;
using InventorySystem.Items.Firearms;
using Firearm = Exiled.API.Features.Items.Firearm;

namespace InfinityAmmo
Expand All @@ -13,7 +10,7 @@ public class EventHandlers
public void OnReloadingWeapon(ReloadingWeaponEventArgs ev)
{
Log.Debug("Reloading!");
ev.Player.SetAmmo(ev.Firearm.AmmoType, Convert.ToUInt16(ev.Firearm.TotalMaxAmmo));
ev.Player.SetAmmo(ev.Firearm.AmmoType, (ushort)(ev.Firearm.TotalMaxAmmo + 1));
}

public void OnShot(ShotEventArgs ev)
Expand Down

0 comments on commit 5d8ec2b

Please sign in to comment.