Closed smt923 closed 9 years ago
I'd like to elaborate on this issue. The amount of bullets in a weapon's clip is only saved to the item when you unequip the item (sh_weapons.lua, line 51) but not on death/disconnecting/reloading. So if you have 4 bullets, shoot one, and you die, you will have 4 bullets in your gun again. If you have 4 bullets, shoot one, then unequip and re-equip your weapon, and then die, you will have 3 bullets, like you should.
Should be easy to fix by saving the amount of bullets in the gun to its item whenever the player dies, disconnects or loads another character. Alternatively, a system could be written that constantly updates the item's ammo.
Basically whenever the ammo for a gun is 0 you can instantly regain a full magazine (the weapon starts with a magazine inside too, which probably shouldn't happen, but whatever) by respawning or killing your self. The ammo stays saved at 0 if you reequip, drop, re-character select or rejoin. Any positive value of ammo stays through deaths.
Latest nutscript 1.1 and hl2rp 1.1 schema, nothing custom that should be touching the ammo system, and no errors