Fix the "weapon sounds stuck playing after death/drop" problem at the core UTWeapon class.

This commit is contained in:
Marisa the Magician 2019-09-28 21:24:37 +02:00
commit 4bbc308eaf
4 changed files with 10 additions and 9 deletions

View file

@ -1336,10 +1336,17 @@ Class UTWeapon : Weapon
if ( amp ) amp.FireEffect();
}
override void DetachFromOwner()
{
Owner.A_StopSound(CHAN_WEAPON);
Super.DetachFromOwner();
}
override void OwnerDied()
{
Super.OwnerDied();
if ( Owner.player && (Owner.player.ReadyWeapon == self) )
Owner.A_StopSound(CHAN_WEAPON);
A_ClearRefire();
Super.OwnerDied();
}
override bool HandlePickup( Inventory item )