I'll do one better and give you the answer here AND in PM. Ha ha, multitasking!Hassat Hunter wrote:He did?
Well, he hasn't been here for around a month, but I send a PM. We shall see if he gives the answer.
The reason why the MJ12 "confiscate" routine reset your amounts of grenades is because of the way it is set up to handle ammo, or rather how it isn't. Because ammo is a separate item, confiscating the weapon doesn't take the ammo with it. However, there's a weapon variable called "PickupAmmoCount" that is used to track (shocker) the amount of ammo you get when you pick up a weapon, but ALSO used to track how much ammo is available for the weapon when it's in your inventory. Since it would be a little unrealistic for a small pistol to be jam-packed with, say, 320 rounds of 10mm ammo, the game resets this variable to default.
Here's the problem: Grenades. For Grenades, the ammo IS the weapon (sort of, work with me on this). When the game takes your LAM, the ammo comes with it (you don't need a LAM launcher or anything silly like that). Unfortunately the "confiscate" routine doesn't take this into account, and merrily resets the PickupAmmoCount on each grenade to default: 1.
All I did to fix the grenade count issue with the confiscate routine was to add some extra qualifiers ("!item.IsA('WeaponLAM') && !item.IsA('WeaponGasGrenade')" etc. etc.) to the part of the routine that resets pickup counts as it moves the items from inventory to shelving. You can see for yourself; the code is in Mission05.uc, though I've since replaced the list of grenades with the single parent class (WeaponGrenade) that I made as part of Shifter. Same concept though.
Hope that's what it is.