• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

PC ammo disappearing from counter

Gladius

Grizzled Veteran
Oct 4, 2011
1,452
81
SCAR gets reloaded to 30 - weapon switch - counter drops to 29


Category: Code

Reproducibility: Sometimes

Description:
1) SCAR gets fully reloaded to 30 rounds
2) weapon gets switched (SCAR put away)
3) ammo in magazine is reduced to 29, within the weapon switch animation

Online + Offline




Video that shows exactly what happens:

http://sendvid.com/hsgl2idv[url]http://sendvid.com/hsgl2idv[/URL]




 
No they "fixed" it 2 times already as far as I know and there was a post by one of the devs afterwards which explained the causality in detail. It's not something that can be easily fixed I think. Something along the lines of the server disregards your reload update as spam/packetloss or whatever. You'd have to look for yourself though...
 
Last edited:
Upvote 0
It mostly happens after shooting and reloading several times. Like there is a small spawn, you shoot 7 bullets - reload - next spawn, you shoot 14 bullets - reload - no spawn, you have a little time and switch to your X-bow to check on your ammo-status - and now when switching back to your SCAR-H, and this happens almost every time, you loose up to 7 bullets on your SCAR-H :(

BTW i did not experience the bug on other weapons perks so far.


EDIT 26.05.2016: Also appears on other perks with different loadouts independent of X-bow usage but it seems that when playing Commando the dissapearance of ammo is more severe than on the other perks, especially on the SCAR-H.


greets
 
Last edited:
Upvote 0
To sum it up:

1. This seems to happen because of ServerSyncReload() (KFWeapon.uc).
2. This happen only online because ServerSyncReload() in online thingy.
3. ServerSyncReload() sets the current ammo counter:
Code:
AmmoCount[0] = Min(AmmoCount[0] + ClientReloadAmount, MagazineCapacity[0]);
MagazineCapacity[0] surely never exceed its normal value (so no subtractions on dry reload) and SpareAmmoCount always subtracted properly and only once per reload, so it is
Code:
AmmoCount[0] + ClientReloadAmount
where it gets messed up.
4. It not always subtracts 1 round from magazine. On high ping servers i had up to -16 rounds subtracted from 45-rounds Bullpup.
5. Ammo subtraction does not seem to happen exactly on reload completion, it likely happen after the replication of AmmoCount when server being notified about client reloading and then through attempting to sync the ammo pools while client have its weapon switched (you shoot some bullets from already half-empty mag, switch to other weapons and remaining ammo pool being subtracted, so does this meant that server not being notified about reload canceling?).
 
Upvote 0