NSWeapon: fix punchangle, add cvar g_infiniteAmmo
This commit is contained in:
parent
52af82b985
commit
760bc4a8fa
7 changed files with 16 additions and 3 deletions
|
@ -47,6 +47,7 @@ entityDef weapon_pistol
|
|||
|
||||
"fireRate" ".2"
|
||||
|
||||
"snd_fire" "weapon_pistol.fire"
|
||||
"actFire" "14,16"
|
||||
"actFireLast" "15,17"
|
||||
"actReload" "8"
|
||||
|
|
|
@ -11,4 +11,3 @@ step_default.right
|
|||
footstep
|
||||
sample common/null.wav
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,9 @@ weapon_bat.miss
|
|||
weapon_pistol.fire
|
||||
{
|
||||
alerts
|
||||
sample weapons/pl_gun3.wav
|
||||
pitch_min 0.95
|
||||
pitch_max 1.05
|
||||
sample weapons/pistol_fire.wav
|
||||
}
|
||||
|
||||
weapon_frag.bounce
|
||||
|
|
BIN
base/resources.pk3dir/sound/weapons/pistol_fire.wav
Normal file
BIN
base/resources.pk3dir/sound/weapons/pistol_fire.wav
Normal file
Binary file not shown.
|
@ -14,6 +14,9 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* TODO: serverinfo based checks for prediction reasons */
|
||||
var bool autocvar_g_infiniteAmmo = false;
|
||||
|
||||
var bool autocvar_ai_debugNav = false;
|
||||
void
|
||||
_NSNavAI_Log(string className, string functionName, float edictNum, string warnMessage)
|
||||
|
|
|
@ -598,6 +598,10 @@ NSNavAI::GiveAmmo(int ammoType, int ammoAmount)
|
|||
bool
|
||||
NSNavAI::UseAmmo(int ammoType, int ammoAmount)
|
||||
{
|
||||
if (autocvar_g_infiniteAmmo == true) {
|
||||
return (true);
|
||||
}
|
||||
|
||||
/* bounds check */
|
||||
if (HasAmmo(ammoType, ammoAmount) == false)
|
||||
return (false);
|
||||
|
|
|
@ -680,6 +680,10 @@ NSWeapon::UseAmmo(string fireInfo)
|
|||
{
|
||||
NSClientPlayer ourOwner = (NSClientPlayer)GetOwner();
|
||||
|
||||
if (autocvar_g_infiniteAmmo == true) {
|
||||
return (true);
|
||||
}
|
||||
|
||||
if (m_fiAmmoRequired) {
|
||||
/* this weapon uses a clip/magazine */
|
||||
if (m_iClipSize && m_fiAmmoType == m_primaryAmmoType) {
|
||||
|
@ -868,7 +872,7 @@ NSWeapon::Attack(string fireInfo)
|
|||
return;
|
||||
}
|
||||
|
||||
ourOwner.punchangle = m_fiPunchAngle;
|
||||
ourOwner.punchangle += m_fiPunchAngle;
|
||||
|
||||
#ifdef SERVER
|
||||
v_angle = input_angles;
|
||||
|
|
Loading…
Reference in a new issue