Added OnSelect() and OnDeselect() to weapons
This commit is contained in:
parent
4d8f715d50
commit
977b5acbe1
2 changed files with 6 additions and 0 deletions
|
|
@ -143,6 +143,10 @@ class Weapon : StateProvider
|
|||
}
|
||||
return -1, 0;
|
||||
}
|
||||
|
||||
virtual void OnSelect() {}
|
||||
|
||||
virtual void OnDeselect() {}
|
||||
|
||||
virtual State GetReadyState ()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1884,6 +1884,7 @@ class PlayerPawn : Actor
|
|||
|
||||
if (weapon != null)
|
||||
{
|
||||
weapon.OnSelect();
|
||||
weapon.PlayUpSound(self);
|
||||
player.refire = 0;
|
||||
|
||||
|
|
@ -1976,6 +1977,7 @@ class PlayerPawn : Actor
|
|||
Weapon weap = player.ReadyWeapon;
|
||||
if ((weap != null) && (player.health > 0 || !weap.bNoDeathDeselect))
|
||||
{
|
||||
weap.OnDeselect();
|
||||
player.SetPsprite(PSP_WEAPON, weap.GetDownState());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue