From 6f8cd70328a9ec1ef1dc74ec07aed72e098f8fc9 Mon Sep 17 00:00:00 2001 From: Night Owl Date: Mon, 17 Jul 2017 10:11:39 +0500 Subject: [PATCH] Merge https://github.com/LevShisterov/BugfixedHL/commit/7a627bf8e3e13929afd7b23ae8435ea8784b4654 --- dlls/satchel.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/dlls/satchel.cpp b/dlls/satchel.cpp index 458ac532..8ddc41a3 100644 --- a/dlls/satchel.cpp +++ b/dlls/satchel.cpp @@ -42,6 +42,9 @@ enum satchel_radio_e class CSatchelCharge : public CGrenade { + Vector m_lastBounceOrigin; // Used to fix a bug in engine: when object isn't moving, but its speed isn't 0 and on ground isn't set + void Spawn( void ); + void Precache( void ); void Spawn( void ); void Precache( void ); void BounceSound( void ); @@ -114,14 +117,19 @@ void CSatchelCharge::SatchelSlide( CBaseEntity *pOther ) } if( !( pev->flags & FL_ONGROUND ) && pev->velocity.Length2D() > 10 ) { + // Fix for a bug in engine: when object isn't moving, but its speed isn't 0 and on ground isn't set + if( pev->origin != m_lastBounceOrigin ) BounceSound(); } - StudioFrameAdvance(); + m_lastBounceOrigin = pev->origin; + // There is no model animation so commented this out to prevent net traffic + // StudioFrameAdvance(); } void CSatchelCharge::SatchelThink( void ) { - StudioFrameAdvance(); + // There is no model animation so commented this out to prevent net traffic + // StudioFrameAdvance(); pev->nextthink = gpGlobals->time + 0.1; if( !IsInWorld() ) @@ -149,7 +157,7 @@ void CSatchelCharge::SatchelThink( void ) void CSatchelCharge::Precache( void ) { - PRECACHE_MODEL( "models/grenade.mdl" ); + PRECACHE_MODEL( "models/w_satchel.mdl" ); PRECACHE_SOUND( "weapons/g_bounce1.wav" ); PRECACHE_SOUND( "weapons/g_bounce2.wav" ); PRECACHE_SOUND( "weapons/g_bounce3.wav" );