View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0006035||Source patches||Multi Theft Auto : San Andreas||public||2011-04-08 18:00||2011-08-06 12:36|
|Target Version||1.1||Fixed in Version||1.1|
|Summary||0006035: Patch for #5987 (takeWeapon / takeWeaponAmmo can result in having negative ammo)|
The problem was that the check on the ammo count after taking it away from the current ammo was that the if statement could never be true. That is because the variable was unsigned so it could never be less than zero! Instead their ammo ended up more like 65535.
So I've fixed that, the source patch compares the current ammo with the amount you want to take away of course if the amount being taken away is greater than the current ammo its going to end up negative, so make it zero. It also makes the value returned by getPedTotalAmmo zero.
|Tags||No tags attached.|