//----------------------------------------------------------------------------- // Purpose: Receive messages from the server // Input : classID - class to receive the message // &msg - message in question //----------------------------------------------------------------------------- void C_GrenadeHopwire::ReceiveMessage( int classID, bf_read &msg ) { if ( classID != GetClientClass()->m_ClassID ) { // Message is for subclass BaseClass::ReceiveMessage( classID, msg ); return; } int messageType = msg.ReadByte(); switch( messageType ) { case HOPWIRE_START_EXPLOSION: { m_ExplosionEffect.SetActive(); m_ExplosionEffect.SetOwner( this ); m_ExplosionEffect.StartExplosion(); } break; case HOPWIRE_STOP_EXPLOSION: { m_ExplosionEffect.StopExplosion(); } break; default: break; } }
//----------------------------------------------------------------------------- // Purpose: Receive messages from the server // Input : classID - class to receive the message // &msg - message in question //----------------------------------------------------------------------------- void C_GrenadeHopwire::ReceiveMessage( int classID, bf_read &msg ) { if ( classID != GetClientClass()->m_ClassID ) { // Message is for subclass BaseClass::ReceiveMessage( classID, msg ); return; } int messageType = msg.ReadByte(); switch( messageType ) { case HOPWIRE_START_EXPLOSION: { m_ExplosionEffect.SetActive(); m_ExplosionEffect.SetOwner( this ); #ifdef C17 C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer(); if (pPlayer) { //pPlayer->EmitSound( "Weapon_AR3.Geiger" ); pPlayer->EmitSound("Weapon_AR3.BlackHole"); } else { //No player? //Emit from the blackhole instead. //EmitSound( "Weapon_AR3.Geiger" ); EmitSound("Weapon_AR3.BlackHole"); } #endif m_ExplosionEffect.StartExplosion(); } break; case HOPWIRE_STOP_EXPLOSION: { m_ExplosionEffect.StopExplosion(); } break; default: break; } }