qbcore-framework / qb-weapons

Weapon Logic Script For QB-Core :gun:
GNU General Public License v3.0
29 stars 194 forks source link

fix: prevent reload if weapon switched to incorrect ammo #199

Closed Qwerty1Verified closed 2 months ago

Qwerty1Verified commented 2 months ago

Describe Pull request This PR checks the ammo type on the progressbar completion callback, without this you are able to switch weapon during the progress bar which will result in the metadata of the incorrect weapon and item being set and increasing the ammo. This is abusable by beginning to reload a pistol with pistol ammo and switching to an assault rifle as the assault rifle will then gain ammo when pulling the weapon back out.

This PR fixes the issue https://github.com/qbcore-framework/qb-inventory/issues/574

Questions (please complete the following information):