Describe the bug
Give yourself 100 flamethrower
Use getPedTotalAmmo on slot 7
Returns 1000.
Caused false positive in my ammo cheat detection script and also if a server saves peoples ammo on quit they can keep quitting and their flame-thrower ammo multiples by ten.
To Reproduce
srun giveWeapon(getRandomPlayer(), 37, 100)srun getPedTotalAmmo(getRandomPlayer(), 7)Expected behavior
Not to be multiplied by 10.
Additional context
MTA10\mods\shared_logic\CClientPed.cpp line 1902 (GiveWeapon):
// Multiply ammo with 10 if flamethrower to get the numbers correct.
if ( weaponType == WEAPONTYPE_FLAMETHROWER ) uiAmmo *= 10;
Maybe just add the same kind of check in getPedTotalAmmo but divide by 10?
Arran's solution is good, however, I would prefer setting the exact number (i.e do not multiply by 10).
Any sort of fix is likely to break backwards compatibility in some way, so what's the best way to break it?
Contributors, please respond with a corresponding emoji:
| emoji | response |
| :---: | :--- |
| :tada: | remove times by ten |
| :heart: | add division by ten |
| :confused: | just leave it alone |
Most helpful comment
Arran's solution is good, however, I would prefer setting the exact number (i.e do not multiply by 10).
Any sort of fix is likely to break backwards compatibility in some way, so what's the best way to break it?
Contributors, please respond with a corresponding emoji:
| emoji | response |
| :---: | :--- |
| :tada: | remove times by ten |
| :heart: | add division by ten |
| :confused: | just leave it alone |