env_shake: active global shake entities can be stopped by removing them from the game now.

This commit is contained in:
Marco Cawthorne 2024-03-05 00:33:37 -08:00
parent a9b6f9a428
commit a3268ef65b
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
22 changed files with 88 additions and 7 deletions

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/ambient_generic.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/env_cubemap.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/info_intermission.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/info_landmark.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -3,6 +3,6 @@
{
map $diffuse
blendFunc blend
alphaFunc GE128
}
}

View File

@ -3,6 +3,6 @@
{
map $diffuse
blendFunc blend
alphaFunc GE128
}
}

View File

@ -0,0 +1,9 @@
{
diffusemap textures/editor/light.tga
{
map $diffuse
rgbGen vertex
alphaFunc GE128
}
}

View File

@ -3,7 +3,7 @@
{
map $diffuse
blendFunc blend
alphaFunc GE128
rgbGen vertex
}
}

View File

@ -3,6 +3,6 @@
{
map $diffuse
blendFunc blend
alphaFunc GE128
}
}

View File

@ -3,6 +3,6 @@
{
map $diffuse
blendFunc blend
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/prop_door_rotating.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/scripted_sentence.tga
{
map $diffuse
alphaFunc GE128
}
}

View File

@ -3,6 +3,6 @@
{
map $diffuse
blendFunc blend
alphaFunc GE128
}
}

View File

@ -46,6 +46,8 @@ public:
virtual void SpawnKey(string,string);
virtual void Trigger(entity, triggermode_t);
virtual void OnRemoveEntity(void);
private:
float m_flRadius;
float m_flAmplitude;
@ -62,6 +64,19 @@ env_shake::env_shake(void)
m_flFrequency = 0.0f;
}
void
env_shake::OnRemoveEntity(void)
{
if (HasSpawnFlags(1)) {
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EV_SHAKE);
WriteFloat(MSG_MULTICAST, 1.0);
WriteFloat(MSG_MULTICAST, m_flAmplitude);
WriteFloat(MSG_MULTICAST, m_flFrequency);
multicast([0,0,0], MULTICAST_ALL_R);
}
}
void
env_shake::Save(float handle)
{
@ -117,5 +132,14 @@ env_shake::SpawnKey(string strKey, string strValue)
void
env_shake::Trigger(entity act, triggermode_t state)
{
Client_ShakeOnce(origin, m_flRadius, m_flDuration, m_flFrequency, m_flAmplitude);
if (HasSpawnFlags(1)) {
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EV_SHAKE);
WriteFloat(MSG_MULTICAST, m_flDuration);
WriteFloat(MSG_MULTICAST, m_flAmplitude);
WriteFloat(MSG_MULTICAST, m_flFrequency);
multicast([0,0,0], MULTICAST_ALL_R);
} else {
Client_ShakeOnce(origin, m_flRadius, m_flDuration, m_flFrequency, m_flAmplitude);
}
}