ambient_generic: Made it fully serverside to avoid headache.
This commit is contained in:
parent
3c42426b43
commit
b9902e94ea
2 changed files with 7 additions and 31 deletions
|
@ -41,11 +41,11 @@ void CSQC_ambient_generic( string sSample, float fVolume, float fAttenuation, fl
|
||||||
fLoop = FALSE;
|
fLoop = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( fLoop ) {
|
/*if ( fLoop ) {
|
||||||
sound( self, CHAN_VOICE, sSample, fVolume, fAttenuation, 0, SOUNDFLAG_FORCELOOP );
|
sound( self, CHAN_VOICE, sSample, fVolume, fAttenuation, 0, SOUNDFLAG_FORCELOOP );
|
||||||
} else {
|
} else {*/
|
||||||
sound( self, CHAN_VOICE, sSample, fVolume, fAttenuation, 0, 0 );
|
sound( self, CHAN_VOICE, sSample, fVolume, fAttenuation, 0, 0 );
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -98,11 +98,7 @@ void CSQC_Ent_Update( float flIsNew ) {
|
||||||
|
|
||||||
CSQC_ambient_generic( readstring(), readfloat(), readbyte(), readbyte(), readbyte() );
|
CSQC_ambient_generic( readstring(), readfloat(), readbyte(), readbyte(), readbyte() );
|
||||||
} else if ( fEntType == ENT_SPRITE ) {
|
} else if ( fEntType == ENT_SPRITE ) {
|
||||||
self.origin_x = readcoord();
|
Sprite_Animated();
|
||||||
self.origin_y = readcoord();
|
|
||||||
self.origin_z = readcoord();
|
|
||||||
|
|
||||||
Effect_AnimatedSprite( self.origin, readfloat(), readfloat(), readfloat(), readfloat(), readfloat() );
|
|
||||||
} else if ( fEntType == ENT_SPRAY ) {
|
} else if ( fEntType == ENT_SPRAY ) {
|
||||||
Spraylogo_Parse();
|
Spraylogo_Parse();
|
||||||
} else if ( fEntType == ENT_DECAL ) {
|
} else if ( fEntType == ENT_DECAL ) {
|
||||||
|
|
|
@ -36,27 +36,8 @@ class ambient_generic:CBaseTrigger
|
||||||
virtual void() Respawn;
|
virtual void() Respawn;
|
||||||
virtual void() UseNormal;
|
virtual void() UseNormal;
|
||||||
virtual void() UseLoop;
|
virtual void() UseLoop;
|
||||||
virtual float(entity, float) Network;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
float ambient_generic::Network(entity ePEnt, float fChanged)
|
|
||||||
{
|
|
||||||
if (!m_iToggleSwitch) {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
WriteByte(MSG_ENTITY, ENT_AMBIENTSOUND);
|
|
||||||
WriteCoord(MSG_ENTITY, origin[0]);
|
|
||||||
WriteCoord(MSG_ENTITY, origin[1]);
|
|
||||||
WriteCoord(MSG_ENTITY, origin[2]);
|
|
||||||
WriteString(MSG_ENTITY, m_strActivePath);
|
|
||||||
WriteFloat(MSG_ENTITY, m_flVolume);
|
|
||||||
WriteByte(MSG_ENTITY, m_flRadius);
|
|
||||||
WriteByte(MSG_ENTITY, m_iLoop);
|
|
||||||
WriteByte(MSG_ENTITY, 0);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ambient_generic::UseNormal(void)
|
void ambient_generic::UseNormal(void)
|
||||||
{
|
{
|
||||||
sound(this, CHAN_VOICE, m_strActivePath, m_flVolume, m_flRadius, m_flPitch);
|
sound(this, CHAN_VOICE, m_strActivePath, m_flVolume, m_flRadius, m_flPitch);
|
||||||
|
@ -69,7 +50,8 @@ void ambient_generic::UseLoop(void)
|
||||||
m_strActivePath = m_strSoundPath;
|
m_strActivePath = m_strSoundPath;
|
||||||
}
|
}
|
||||||
m_iToggleSwitch = 1 - m_iToggleSwitch;
|
m_iToggleSwitch = 1 - m_iToggleSwitch;
|
||||||
SendFlags = 1;
|
|
||||||
|
UseNormal();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ambient_generic::Respawn(void)
|
void ambient_generic::Respawn(void)
|
||||||
|
@ -90,11 +72,9 @@ void ambient_generic::Respawn(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_iLoop) {
|
if (m_iLoop) {
|
||||||
pvsflags = PVSF_USEPHS;
|
|
||||||
Trigger = UseLoop;
|
Trigger = UseLoop;
|
||||||
SendEntity = Network;
|
|
||||||
SendFlags = 1;
|
|
||||||
}
|
}
|
||||||
|
UseNormal();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ambient_generic::ambient_generic (void)
|
void ambient_generic::ambient_generic (void)
|
||||||
|
|
Loading…
Reference in a new issue