Open Raptor007 opened 8 years ago
Ammo when picking up a weapon is controlled by p_weapon.c Pickup_Weapon
: https://github.com/Raptor007/aq2-tng/blob/ff13fc5b37ce31e67ec14c76f0e92ccf543438bf/source/p_weapon.c#L264
The weapon's current ammo will need to be assigned to the dropped item in p_weapon.c Drop_Weapon
: https://github.com/Raptor007/aq2-tng/blob/ff13fc5b37ce31e67ec14c76f0e92ccf543438bf/source/p_weapon.c#L806
It looks like temp->count
would be a good variable to use.
When this cvar is enabled, dead players should also drop their extra magazines.
This cvar should also prevent pistols from refilling automatically when you pick up another.
Actually it looks like g_items.c Drop_Item
would be the appropriate place to set the dropped ammo count, so that it also applies to dying players: https://github.com/Raptor007/aq2-tng/blob/1317847b3ee94291c3e9493af06350af9ea4b3da/source/g_items.c#L908-L972
The weapons should remember their ammo count when dropped. If you drop an MP5 with 12 rounds in it, the next person who picks it up should have 12 rounds in it. This will be an optional cvar because it changes the gameplay.