NSWeapon: add method WeaponIsFiring()
This commit is contained in:
parent
caac73bec9
commit
7c68a0317e
2 changed files with 15 additions and 4 deletions
|
@ -142,6 +142,9 @@ public:
|
|||
/** Overridable: Called once when the weapon stopped firing. */
|
||||
virtual void WeaponStoppedFiring(void);
|
||||
|
||||
/** Returns whether the weapon is being actively fired by the owner. */
|
||||
nonvirtual bool WeaponIsFiring(void);
|
||||
|
||||
/** Overridable: Controls def_onFire event. */
|
||||
virtual void FiredWeaponAttack(string);
|
||||
/** Overridable: Controls def_onRelease event. */
|
||||
|
@ -167,6 +170,8 @@ private:
|
|||
nonvirtual void _SwitchedFromCallback(void);
|
||||
/** Called to cache some entityDef values. */
|
||||
nonvirtual void _CacheWeaponDefVariables(void);
|
||||
nonvirtual void _WeaponStartedFiring(void);
|
||||
nonvirtual void _WeaponStoppedFiring(void);
|
||||
|
||||
#ifdef SERVER
|
||||
nonvirtual void _ReloadFinished(void);
|
||||
|
|
|
@ -1092,11 +1092,11 @@ NSWeapon::_WeaponStartedFiring(void)
|
|||
}
|
||||
|
||||
/* hasn't been fired yet. */
|
||||
if (!(vv_flags & VFL_FIRING)) {
|
||||
if (!(owner.vv_flags & VFL_FIRING)) {
|
||||
WeaponStartedFiring();
|
||||
}
|
||||
|
||||
vv_flags |= VFL_FIRING;
|
||||
owner.vv_flags |= VFL_FIRING;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1107,11 +1107,17 @@ NSWeapon::_WeaponStoppedFiring(void)
|
|||
}
|
||||
|
||||
/* was still registed as firing */
|
||||
if (vv_flags & VFL_FIRING) {
|
||||
if (owner.vv_flags & VFL_FIRING) {
|
||||
WeaponStoppedFiring();
|
||||
}
|
||||
|
||||
vv_flags &= ~VFL_FIRING;
|
||||
owner.vv_flags &= ~VFL_FIRING;
|
||||
}
|
||||
|
||||
bool
|
||||
NSWeapon::WeaponIsFiring(void)
|
||||
{
|
||||
return (owner.vv_flags & VFL_FIRING) ? (true) : (false);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue