We are developing a multiplayer FPS game and have encountered a problem with ammo counting.
AmmoInventory -= 1.f; should deduct 1 ammo from the rocket launcher. However, for some reason, the first time it does this, 2 ammo is deducted instead of 1.
This bug occurs only in multicast. 1 ammo is correctly removed on the server.
So, for example, if our Rocket Launcher has max 30 ammo and I fire one shot, I erroneously get 28 rocket ammo left on multicast and 29 on the server.
How can we get the counter to match up properly?
It’s funny how UE4 appears to believe 30 - 1 = 28