From df34e24de57aa4aa3ba4f0eccae215a342f0afc4 Mon Sep 17 00:00:00 2001 From: tankefugl Date: Fri, 26 May 2006 22:22:31 +0000 Subject: [PATCH] o Fixed bug that caused +attack leap animations not to play. git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@506 67975925-1194-0748-b3d5-c16f83f1a3a1 --- releases/3.2.0/source/cl_dll/hl/hl_weapons.cpp | 8 ++++++-- releases/3.2.0/source/mod/AvHAlienAbilities.cpp | 3 ++- releases/3.2.0/source/mod/AvHEvents.cpp | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/releases/3.2.0/source/cl_dll/hl/hl_weapons.cpp b/releases/3.2.0/source/cl_dll/hl/hl_weapons.cpp index 96bc213..bddb657 100644 --- a/releases/3.2.0/source/cl_dll/hl/hl_weapons.cpp +++ b/releases/3.2.0/source/cl_dll/hl/hl_weapons.cpp @@ -474,7 +474,7 @@ void CBasePlayerWeapon::ItemPostFrame( void ) { // Hack initialization - if (this->m_flLastAnimationPlayed >= 3 * BALANCE_VAR(kLeapROF) * gpGlobals->time) + if (this->m_flLastAnimationPlayed >= 3 * BALANCE_VAR(kLeapROF) + gpGlobals->time) this->m_flLastAnimationPlayed = 0.0f; if ((m_fInReload) && (m_pPlayer->m_flNextAttack <= 0.0)) @@ -603,7 +603,11 @@ void CBasePlayerWeapon::ItemPostFrame( void ) } } - this->PrevAttack2Status = true; + if (this->m_flLastAnimationPlayed + BALANCE_VAR(kLeapROF) < gpGlobals->time) + this->PrevAttack2Status = false; + else + this->PrevAttack2Status = true; + return; // if (GetCanUseWeapon()) // { diff --git a/releases/3.2.0/source/mod/AvHAlienAbilities.cpp b/releases/3.2.0/source/mod/AvHAlienAbilities.cpp index da579a3..cc40b42 100644 --- a/releases/3.2.0/source/mod/AvHAlienAbilities.cpp +++ b/releases/3.2.0/source/mod/AvHAlienAbilities.cpp @@ -149,7 +149,7 @@ void AvHLeap::Spawn() float AvHLeap::GetRateOfFire(void) const { - return (float)BALANCE_VAR(kLeapROF); + return (float)BALANCE_VAR(kLeapROF) * 0.5f; } bool AvHLeap::UsesAmmo(void) const @@ -177,6 +177,7 @@ void AvHLeap::FireProjectiles(void) if(g_runfuncs) { //IN_Attack2Down(); + //this->SendWeaponAnim(3); gHUD.SetAlienAbility(this->GetAbilityImpulse()); } #endif diff --git a/releases/3.2.0/source/mod/AvHEvents.cpp b/releases/3.2.0/source/mod/AvHEvents.cpp index 5b7a3f6..f745f7d 100644 --- a/releases/3.2.0/source/mod/AvHEvents.cpp +++ b/releases/3.2.0/source/mod/AvHEvents.cpp @@ -3014,9 +3014,9 @@ void EV_Devour(struct event_args_s* inArgs) void EV_Leap(struct event_args_s* inArgs) { - char* theSoundToPlay = kLeapSound; + //char* theSoundToPlay = kLeapSound; - // gEngfuncs.pEventAPI->EV_PlaySound(inArgs->entindex, inArgs->origin, CHAN_WEAPON, theSoundToPlay, inArgs->fparam1, ATTN_NORM, 0, 94 + gEngfuncs.pfnRandomLong( 0, 0xf )); + //gEngfuncs.pEventAPI->EV_PlaySound(inArgs->entindex, inArgs->origin, CHAN_WEAPON, theSoundToPlay, inArgs->fparam1, ATTN_NORM, 0, 94 + gEngfuncs.pfnRandomLong( 0, 0xf )); if (EV_IsLocal(inArgs->entindex)) {