Adds events for when players pick up and drop weapons, grenades, and bomb as proposed in issue #117 . This includes spawns and purchases for pickups and deaths and grenade throws for drops along with picking up and dropping weapons onto the ground or other players.
Implementation isn't as clean as I'd like. I wanted PickupWeapon to have the correct player and weapon data when it is raised, but these are added in two different steps, the order of which isn't consistent and it seems the weapon can be swapped out later on in the tick anyways. My solution was to create a separate container for new weapons and raise PickupWeapon at the end of ParseNextTick.
Raising an event on the second flashbang also required a new member variable, FlashHandle to track the flashbang. The alternative was to hardcode the AmmoType (15) or iterate over player.Weapons on every ammo update and double check that a match was in fact a flashbang rather than trickery.
Adds events for when players pick up and drop weapons, grenades, and bomb as proposed in issue #117 . This includes spawns and purchases for pickups and deaths and grenade throws for drops along with picking up and dropping weapons onto the ground or other players.
Implementation isn't as clean as I'd like. I wanted
PickupWeapon
to have the correct player and weapon data when it is raised, but these are added in two different steps, the order of which isn't consistent and it seems the weapon can be swapped out later on in the tick anyways. My solution was to create a separate container for new weapons and raisePickupWeapon
at the end ofParseNextTick
.Raising an event on the second flashbang also required a new member variable,
FlashHandle
to track the flashbang. The alternative was to hardcode theAmmoType
(15) or iterate overplayer.Weapons
on every ammo update and double check that a match was in fact a flashbang rather than trickery.