• 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 Why no answers this? (If a magazine capacity exceeds 255, ammo disappear when changing weapons)

duk6046

Grizzled Veteran
Jul 15, 2009
144
8

Is it impossible to fix?

Category: Code

Reproducibility: Always

Summary: If a magazine capacity exceeds 255, ammo disappear when changing weapons (swap).

Description: I seems the magazine capacity code is recently changed from byte to int, but there a problem with inventory or other code. Please fix it for custom server
 
Last edited:
This is a case where it is likely the custom mod/mutator should be changed to fix this issue as there doesn't appear to be an issue in the stock code here.
I found a suspicious code in KFInventoryManager.
'local byte MagAmmoCount;' of 'simulated function final BuyAmmo( float AmountPurchased, EItemType ItemType, optional byte ItemIndex, optional bool bSecondaryAmmo )' and
'byte ClientAmmoCount' of 'reliable server final private function ServerBuyAmmo(int AmountPurchased, byte ClientAmmoCount, byte ItemIndex, bool bSecondaryAmmo)' lines
are these not relevant?
 
Upvote 0