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. */
|
/** Overridable: Called once when the weapon stopped firing. */
|
||||||
virtual void WeaponStoppedFiring(void);
|
virtual void WeaponStoppedFiring(void);
|
||||||
|
|
||||||
|
/** Returns whether the weapon is being actively fired by the owner. */
|
||||||
|
nonvirtual bool WeaponIsFiring(void);
|
||||||
|
|
||||||
/** Overridable: Controls def_onFire event. */
|
/** Overridable: Controls def_onFire event. */
|
||||||
virtual void FiredWeaponAttack(string);
|
virtual void FiredWeaponAttack(string);
|
||||||
/** Overridable: Controls def_onRelease event. */
|
/** Overridable: Controls def_onRelease event. */
|
||||||
|
@ -167,6 +170,8 @@ private:
|
||||||
nonvirtual void _SwitchedFromCallback(void);
|
nonvirtual void _SwitchedFromCallback(void);
|
||||||
/** Called to cache some entityDef values. */
|
/** Called to cache some entityDef values. */
|
||||||
nonvirtual void _CacheWeaponDefVariables(void);
|
nonvirtual void _CacheWeaponDefVariables(void);
|
||||||
|
nonvirtual void _WeaponStartedFiring(void);
|
||||||
|
nonvirtual void _WeaponStoppedFiring(void);
|
||||||
|
|
||||||
#ifdef SERVER
|
#ifdef SERVER
|
||||||
nonvirtual void _ReloadFinished(void);
|
nonvirtual void _ReloadFinished(void);
|
||||||
|
|
|
@ -1092,11 +1092,11 @@ NSWeapon::_WeaponStartedFiring(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* hasn't been fired yet. */
|
/* hasn't been fired yet. */
|
||||||
if (!(vv_flags & VFL_FIRING)) {
|
if (!(owner.vv_flags & VFL_FIRING)) {
|
||||||
WeaponStartedFiring();
|
WeaponStartedFiring();
|
||||||
}
|
}
|
||||||
|
|
||||||
vv_flags |= VFL_FIRING;
|
owner.vv_flags |= VFL_FIRING;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1107,11 +1107,17 @@ NSWeapon::_WeaponStoppedFiring(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* was still registed as firing */
|
/* was still registed as firing */
|
||||||
if (vv_flags & VFL_FIRING) {
|
if (owner.vv_flags & VFL_FIRING) {
|
||||||
WeaponStoppedFiring();
|
WeaponStoppedFiring();
|
||||||
}
|
}
|
||||||
|
|
||||||
vv_flags &= ~VFL_FIRING;
|
owner.vv_flags &= ~VFL_FIRING;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
NSWeapon::WeaponIsFiring(void)
|
||||||
|
{
|
||||||
|
return (owner.vv_flags & VFL_FIRING) ? (true) : (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue