ambient_generic/speaker: force spawnflag MSF_MULTIPLAYER within Spawned() instead of the constructor.
This commit is contained in:
parent
177a1638f7
commit
1b21a6cf46
2 changed files with 17 additions and 3 deletions
|
@ -114,7 +114,6 @@ ambient_generic::ambient_generic(void)
|
||||||
m_strSpawnPath = __NULL__;
|
m_strSpawnPath = __NULL__;
|
||||||
m_flSpawnVolume = 0.0f;
|
m_flSpawnVolume = 0.0f;
|
||||||
m_flSpawnPitch = 0.0f;
|
m_flSpawnPitch = 0.0f;
|
||||||
spawnflags |= MSF_MULTIPLAYER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -205,6 +204,7 @@ ambient_generic::SpawnKey(string strKey, string strValue)
|
||||||
break;
|
break;
|
||||||
case "radius":
|
case "radius":
|
||||||
m_bIsModern = true;
|
m_bIsModern = true;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
super::SpawnKey(strKey, strValue);
|
super::SpawnKey(strKey, strValue);
|
||||||
break;
|
break;
|
||||||
|
@ -214,6 +214,9 @@ ambient_generic::SpawnKey(string strKey, string strValue)
|
||||||
void
|
void
|
||||||
ambient_generic::Spawned(void)
|
ambient_generic::Spawned(void)
|
||||||
{
|
{
|
||||||
|
/* HACK: avoid de-spawning */
|
||||||
|
spawnflags |= MSF_MULTIPLAYER;
|
||||||
|
|
||||||
super::Spawned();
|
super::Spawned();
|
||||||
precache_sound(m_strSpawnPath);
|
precache_sound(m_strSpawnPath);
|
||||||
}
|
}
|
||||||
|
@ -223,6 +226,7 @@ ambient_generic::Respawn(void)
|
||||||
{
|
{
|
||||||
SetSize([0,0,0], [0,0,0]);
|
SetSize([0,0,0], [0,0,0]);
|
||||||
SetOrigin(GetSpawnOrigin());
|
SetOrigin(GetSpawnOrigin());
|
||||||
|
|
||||||
m_strActivePath = m_strSpawnPath;
|
m_strActivePath = m_strSpawnPath;
|
||||||
m_flPitch = m_flSpawnPitch;
|
m_flPitch = m_flSpawnPitch;
|
||||||
m_flVolume = m_flSpawnVolume;
|
m_flVolume = m_flSpawnVolume;
|
||||||
|
@ -397,6 +401,7 @@ ambient_generic::ReceiveEntity(float isnew, float flChanged)
|
||||||
origin[0] = readcoord();
|
origin[0] = readcoord();
|
||||||
origin[1] = readcoord();
|
origin[1] = readcoord();
|
||||||
origin[2] = readcoord();
|
origin[2] = readcoord();
|
||||||
|
solid = SOLID_NOT;
|
||||||
setsize(this, [0,0,0], [0,0,0]);
|
setsize(this, [0,0,0], [0,0,0]);
|
||||||
setorigin(this, origin);
|
setorigin(this, origin);
|
||||||
drawmask = MASK_ENGINE;
|
drawmask = MASK_ENGINE;
|
||||||
|
@ -419,8 +424,7 @@ ambient_generic::ReceiveEntity(float isnew, float flChanged)
|
||||||
if (flChanged & AMBIENT_ENABLED)
|
if (flChanged & AMBIENT_ENABLED)
|
||||||
m_bLoops = readbyte();
|
m_bLoops = readbyte();
|
||||||
|
|
||||||
NSLog("Sound received: %S Volume: %f; Radius: %d; Pitch: %d", m_strActivePath, m_flVolume, m_flRadius, m_flPitch);
|
SndLog("Sound received: %S Volume: %f; Radius: %d; Pitch: %d, Org: %v", m_strActivePath, m_flVolume, m_flRadius, m_flPitch, origin);
|
||||||
|
|
||||||
|
|
||||||
if (m_bLoops == true) {
|
if (m_bLoops == true) {
|
||||||
if (flChanged & AMBIENT_MODERN) {
|
if (flChanged & AMBIENT_MODERN) {
|
||||||
|
|
|
@ -77,6 +77,7 @@ public:
|
||||||
virtual void Save(float);
|
virtual void Save(float);
|
||||||
virtual void Restore(string,string);
|
virtual void Restore(string,string);
|
||||||
virtual void SpawnKey(string,string);
|
virtual void SpawnKey(string,string);
|
||||||
|
virtual void Spawned(void);
|
||||||
virtual void Respawn(void);
|
virtual void Respawn(void);
|
||||||
virtual void Trigger(entity, triggermode_t);
|
virtual void Trigger(entity, triggermode_t);
|
||||||
|
|
||||||
|
@ -153,6 +154,15 @@ speaker::SpawnKey(string strKey, string strValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
speaker::Spawned(void)
|
||||||
|
{
|
||||||
|
/* HACK: avoid de-spawning */
|
||||||
|
spawnflags |= MSF_MULTIPLAYER;
|
||||||
|
|
||||||
|
super::Spawned();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
speaker::Respawn(void)
|
speaker::Respawn(void)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue