2010-11-20 10:37:14 +00:00
|
|
|
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
|
|
|
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
2011-08-31 11:56:04 +00:00
|
|
|
|
|
|
|
#include <base/tl/sorted_array.h>
|
|
|
|
|
2010-10-19 11:37:36 +00:00
|
|
|
#include <engine/demo.h>
|
2011-02-27 16:56:03 +00:00
|
|
|
#include <engine/engine.h>
|
|
|
|
|
2010-11-24 00:11:56 +00:00
|
|
|
#include <engine/shared/config.h>
|
2010-10-19 11:37:36 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
#include <game/generated/client_data.h>
|
2008-08-27 15:48:50 +00:00
|
|
|
|
2020-09-26 19:41:58 +00:00
|
|
|
#include <game/client/components/damageind.h>
|
|
|
|
#include <game/client/components/flow.h>
|
2010-05-29 07:25:38 +00:00
|
|
|
#include <game/client/components/particles.h>
|
|
|
|
#include <game/client/components/skins.h>
|
|
|
|
#include <game/client/components/sounds.h>
|
|
|
|
#include <game/client/gameclient.h>
|
2008-08-27 15:48:50 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
#include "effects.h"
|
2008-08-27 15:48:50 +00:00
|
|
|
|
2021-01-12 18:25:20 +00:00
|
|
|
inline vec2 RandomDir() { return normalize(vec2(random_float() - 0.5f, random_float() - 0.5f)); }
|
2008-08-30 21:09:13 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
CEffects::CEffects()
|
2008-08-27 15:48:50 +00:00
|
|
|
{
|
2010-05-29 07:25:38 +00:00
|
|
|
m_Add50hz = false;
|
|
|
|
m_Add100hz = false;
|
2008-08-27 15:48:50 +00:00
|
|
|
}
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void CEffects::AirJump(vec2 Pos)
|
2008-08-27 15:48:50 +00:00
|
|
|
{
|
2010-05-29 07:25:38 +00:00
|
|
|
CParticle p;
|
|
|
|
p.SetDefault();
|
|
|
|
p.m_Spr = SPRITE_PART_AIRJUMP;
|
|
|
|
p.m_Pos = Pos + vec2(-6.0f, 16.0f);
|
|
|
|
p.m_Vel = vec2(0, -200);
|
|
|
|
p.m_LifeSpan = 0.5f;
|
|
|
|
p.m_StartSize = 48.0f;
|
|
|
|
p.m_EndSize = 0;
|
2021-01-12 18:25:20 +00:00
|
|
|
p.m_Rot = random_float() * pi * 2;
|
2020-09-26 19:41:58 +00:00
|
|
|
p.m_Rotspeed = pi * 2;
|
2010-05-29 07:25:38 +00:00
|
|
|
p.m_Gravity = 500;
|
|
|
|
p.m_Friction = 0.7f;
|
|
|
|
p.m_FlowAffected = 0.0f;
|
2021-07-12 09:43:56 +00:00
|
|
|
m_pClient->m_Particles.Add(CParticles::GROUP_GENERAL, &p);
|
2008-08-27 15:48:50 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
p.m_Pos = Pos + vec2(6.0f, 16.0f);
|
2021-07-12 09:43:56 +00:00
|
|
|
m_pClient->m_Particles.Add(CParticles::GROUP_GENERAL, &p);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2014-10-25 00:52:08 +00:00
|
|
|
if(g_Config.m_SndGame)
|
2021-07-12 09:43:56 +00:00
|
|
|
m_pClient->m_Sounds.PlayAt(CSounds::CHN_WORLD, SOUND_PLAYER_AIRJUMP, 1.0f, Pos);
|
2008-08-27 15:48:50 +00:00
|
|
|
}
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void CEffects::DamageIndicator(vec2 Pos, vec2 Dir)
|
2008-08-27 15:48:50 +00:00
|
|
|
{
|
2021-07-12 09:43:56 +00:00
|
|
|
m_pClient->m_DamageInd.Create(Pos, Dir);
|
2008-08-27 15:48:50 +00:00
|
|
|
}
|
|
|
|
|
2014-09-03 12:17:44 +00:00
|
|
|
void CEffects::ResetDamageIndicator()
|
|
|
|
{
|
2021-07-12 09:43:56 +00:00
|
|
|
m_pClient->m_DamageInd.Reset();
|
2014-09-03 12:17:44 +00:00
|
|
|
}
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void CEffects::PowerupShine(vec2 Pos, vec2 size)
|
2008-08-27 15:48:50 +00:00
|
|
|
{
|
2010-05-29 07:25:38 +00:00
|
|
|
if(!m_Add50hz)
|
2008-08-27 15:48:50 +00:00
|
|
|
return;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
CParticle p;
|
|
|
|
p.SetDefault();
|
|
|
|
p.m_Spr = SPRITE_PART_SLICE;
|
2021-01-12 18:25:20 +00:00
|
|
|
p.m_Pos = Pos + vec2((random_float() - 0.5f) * size.x, (random_float() - 0.5f) * size.y);
|
2010-05-29 07:25:38 +00:00
|
|
|
p.m_Vel = vec2(0, 0);
|
|
|
|
p.m_LifeSpan = 0.5f;
|
|
|
|
p.m_StartSize = 16.0f;
|
|
|
|
p.m_EndSize = 0;
|
2021-01-12 18:25:20 +00:00
|
|
|
p.m_Rot = random_float() * pi * 2;
|
2020-09-26 19:41:58 +00:00
|
|
|
p.m_Rotspeed = pi * 2;
|
2010-05-29 07:25:38 +00:00
|
|
|
p.m_Gravity = 500;
|
|
|
|
p.m_Friction = 0.9f;
|
|
|
|
p.m_FlowAffected = 0.0f;
|
2021-07-12 09:43:56 +00:00
|
|
|
m_pClient->m_Particles.Add(CParticles::GROUP_GENERAL, &p);
|
2008-08-27 15:48:50 +00:00
|
|
|
}
|
|
|
|
|
2019-07-16 20:06:57 +00:00
|
|
|
void CEffects::SmokeTrail(vec2 Pos, vec2 Vel, float Alpha, float TimePassed)
|
2008-08-27 15:48:50 +00:00
|
|
|
{
|
2019-04-11 22:46:54 +00:00
|
|
|
if(!m_Add50hz && TimePassed < 0.001f)
|
2008-08-27 15:48:50 +00:00
|
|
|
return;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
CParticle p;
|
|
|
|
p.SetDefault();
|
|
|
|
p.m_Spr = SPRITE_PART_SMOKE;
|
|
|
|
p.m_Pos = Pos;
|
2020-09-26 19:41:58 +00:00
|
|
|
p.m_Vel = Vel + RandomDir() * 50.0f;
|
2021-01-12 18:25:20 +00:00
|
|
|
p.m_LifeSpan = 0.5f + random_float() * 0.5f;
|
|
|
|
p.m_StartSize = 12.0f + random_float() * 8;
|
2010-05-29 07:25:38 +00:00
|
|
|
p.m_EndSize = 0;
|
2011-04-19 14:10:50 +00:00
|
|
|
p.m_Friction = 0.7f;
|
2021-01-12 18:25:20 +00:00
|
|
|
p.m_Gravity = random_float() * -500.0f;
|
2019-07-16 20:06:57 +00:00
|
|
|
p.m_Color.a *= Alpha;
|
2021-07-12 09:43:56 +00:00
|
|
|
m_pClient->m_Particles.Add(CParticles::GROUP_PROJECTILE_TRAIL, &p, TimePassed);
|
2008-08-27 15:48:50 +00:00
|
|
|
}
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void CEffects::SkidTrail(vec2 Pos, vec2 Vel)
|
2008-08-27 15:48:50 +00:00
|
|
|
{
|
2010-05-29 07:25:38 +00:00
|
|
|
if(!m_Add100hz)
|
2008-08-27 15:48:50 +00:00
|
|
|
return;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
CParticle p;
|
|
|
|
p.SetDefault();
|
|
|
|
p.m_Spr = SPRITE_PART_SMOKE;
|
|
|
|
p.m_Pos = Pos;
|
2020-09-26 19:41:58 +00:00
|
|
|
p.m_Vel = Vel + RandomDir() * 50.0f;
|
2021-01-12 18:25:20 +00:00
|
|
|
p.m_LifeSpan = 0.5f + random_float() * 0.5f;
|
|
|
|
p.m_StartSize = 24.0f + random_float() * 12;
|
2010-05-29 07:25:38 +00:00
|
|
|
p.m_EndSize = 0;
|
|
|
|
p.m_Friction = 0.7f;
|
2021-01-12 18:25:20 +00:00
|
|
|
p.m_Gravity = random_float() * -500.0f;
|
2020-09-26 19:41:58 +00:00
|
|
|
p.m_Color = ColorRGBA(0.75f, 0.75f, 0.75f, 1.0f);
|
2021-07-12 09:43:56 +00:00
|
|
|
m_pClient->m_Particles.Add(CParticles::GROUP_GENERAL, &p);
|
2008-08-27 15:48:50 +00:00
|
|
|
}
|
|
|
|
|
2019-07-16 20:06:57 +00:00
|
|
|
void CEffects::BulletTrail(vec2 Pos, float Alpha, float TimePassed)
|
2008-08-27 15:48:50 +00:00
|
|
|
{
|
2019-04-11 22:46:54 +00:00
|
|
|
if(!m_Add100hz && TimePassed < 0.001f)
|
2008-08-27 15:48:50 +00:00
|
|
|
return;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
CParticle p;
|
|
|
|
p.SetDefault();
|
|
|
|
p.m_Spr = SPRITE_PART_BALL;
|
|
|
|
p.m_Pos = Pos;
|
2021-01-12 18:25:20 +00:00
|
|
|
p.m_LifeSpan = 0.25f + random_float() * 0.25f;
|
2010-05-29 07:25:38 +00:00
|
|
|
p.m_StartSize = 8.0f;
|
|
|
|
p.m_EndSize = 0;
|
|
|
|
p.m_Friction = 0.7f;
|
2019-07-16 20:06:57 +00:00
|
|
|
p.m_Color.a *= Alpha;
|
2021-07-12 09:43:56 +00:00
|
|
|
m_pClient->m_Particles.Add(CParticles::GROUP_PROJECTILE_TRAIL, &p, TimePassed);
|
2008-08-27 15:48:50 +00:00
|
|
|
}
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void CEffects::PlayerSpawn(vec2 Pos)
|
2008-08-27 15:48:50 +00:00
|
|
|
{
|
|
|
|
for(int i = 0; i < 32; i++)
|
|
|
|
{
|
2010-05-29 07:25:38 +00:00
|
|
|
CParticle p;
|
|
|
|
p.SetDefault();
|
|
|
|
p.m_Spr = SPRITE_PART_SHELL;
|
|
|
|
p.m_Pos = Pos;
|
2021-01-12 18:25:20 +00:00
|
|
|
p.m_Vel = RandomDir() * (powf(random_float(), 3) * 600.0f);
|
|
|
|
p.m_LifeSpan = 0.3f + random_float() * 0.3f;
|
|
|
|
p.m_StartSize = 64.0f + random_float() * 32;
|
2010-05-29 07:25:38 +00:00
|
|
|
p.m_EndSize = 0;
|
2021-01-12 18:25:20 +00:00
|
|
|
p.m_Rot = random_float() * pi * 2;
|
|
|
|
p.m_Rotspeed = random_float();
|
|
|
|
p.m_Gravity = random_float() * -400.0f;
|
2010-05-29 07:25:38 +00:00
|
|
|
p.m_Friction = 0.7f;
|
2020-09-26 19:41:58 +00:00
|
|
|
p.m_Color = ColorRGBA(0xb5 / 255.0f, 0x50 / 255.0f, 0xcb / 255.0f, 1.0f);
|
2021-07-12 09:43:56 +00:00
|
|
|
m_pClient->m_Particles.Add(CParticles::GROUP_GENERAL, &p);
|
2008-08-27 15:48:50 +00:00
|
|
|
}
|
2014-10-25 00:52:08 +00:00
|
|
|
if(g_Config.m_SndGame)
|
2021-07-12 09:43:56 +00:00
|
|
|
m_pClient->m_Sounds.PlayAt(CSounds::CHN_WORLD, SOUND_PLAYER_SPAWN, 1.0f, Pos);
|
2008-08-27 15:48:50 +00:00
|
|
|
}
|
|
|
|
|
2011-02-12 10:40:36 +00:00
|
|
|
void CEffects::PlayerDeath(vec2 Pos, int ClientID)
|
2008-08-27 15:48:50 +00:00
|
|
|
{
|
2020-09-26 19:41:58 +00:00
|
|
|
ColorRGBA BloodColor(1.0f, 1.0f, 1.0f);
|
2008-08-27 15:48:50 +00:00
|
|
|
|
2011-04-13 18:37:12 +00:00
|
|
|
if(ClientID >= 0)
|
2008-08-27 15:48:50 +00:00
|
|
|
{
|
2022-03-18 23:31:49 +00:00
|
|
|
// Use m_RenderInfo.m_CustomColoredSkin instead of m_UseCustomColor
|
|
|
|
// m_UseCustomColor says if the player's skin has a custom color (value sent from the client side)
|
|
|
|
|
|
|
|
// m_RenderInfo.m_CustomColoredSkin Defines if in the context of the game the color is being customized,
|
|
|
|
// Using this value if the game is teams (red and blue), this value will be true even if the skin is with the normal color.
|
|
|
|
// And will use the team body color to create player death effect instead of tee color
|
|
|
|
if(m_pClient->m_aClients[ClientID].m_RenderInfo.m_CustomColoredSkin)
|
2020-10-08 19:54:53 +00:00
|
|
|
BloodColor = m_pClient->m_aClients[ClientID].m_RenderInfo.m_ColorBody;
|
2010-11-24 00:11:56 +00:00
|
|
|
else
|
|
|
|
{
|
2020-10-09 07:07:05 +00:00
|
|
|
BloodColor = m_pClient->m_aClients[ClientID].m_RenderInfo.m_BloodColor;
|
2010-11-24 00:11:56 +00:00
|
|
|
}
|
2008-08-27 15:48:50 +00:00
|
|
|
}
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2008-08-27 15:48:50 +00:00
|
|
|
for(int i = 0; i < 64; i++)
|
|
|
|
{
|
2010-05-29 07:25:38 +00:00
|
|
|
CParticle p;
|
|
|
|
p.SetDefault();
|
2020-09-26 19:41:58 +00:00
|
|
|
p.m_Spr = SPRITE_PART_SPLAT01 + (rand() % 3);
|
2010-05-29 07:25:38 +00:00
|
|
|
p.m_Pos = Pos;
|
2021-01-12 18:25:20 +00:00
|
|
|
p.m_Vel = RandomDir() * ((random_float() + 0.1f) * 900.0f);
|
|
|
|
p.m_LifeSpan = 0.3f + random_float() * 0.3f;
|
|
|
|
p.m_StartSize = 24.0f + random_float() * 16;
|
2010-05-29 07:25:38 +00:00
|
|
|
p.m_EndSize = 0;
|
2021-01-12 18:25:20 +00:00
|
|
|
p.m_Rot = random_float() * pi * 2;
|
|
|
|
p.m_Rotspeed = (random_float() - 0.5f) * pi;
|
2010-05-29 07:25:38 +00:00
|
|
|
p.m_Gravity = 800.0f;
|
|
|
|
p.m_Friction = 0.8f;
|
2021-01-12 18:25:20 +00:00
|
|
|
ColorRGBA c = BloodColor.v4() * (0.75f + random_float() * 0.25f);
|
2019-04-26 21:47:34 +00:00
|
|
|
p.m_Color = ColorRGBA(c.r, c.g, c.b, 0.75f);
|
2021-07-12 09:43:56 +00:00
|
|
|
m_pClient->m_Particles.Add(CParticles::GROUP_GENERAL, &p);
|
2008-08-27 15:48:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void CEffects::Explosion(vec2 Pos)
|
2008-08-27 15:48:50 +00:00
|
|
|
{
|
|
|
|
// add to flow
|
|
|
|
for(int y = -8; y <= 8; y++)
|
|
|
|
for(int x = -8; x <= 8; x++)
|
|
|
|
{
|
|
|
|
if(x == 0 && y == 0)
|
|
|
|
continue;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2020-09-26 19:41:58 +00:00
|
|
|
float a = 1 - (length(vec2(x, y)) / length(vec2(8, 8)));
|
2021-07-12 09:43:56 +00:00
|
|
|
m_pClient->m_Flow.Add(Pos + vec2(x, y) * 16, normalize(vec2(x, y)) * 5000.0f * a, 10.0f);
|
2008-08-27 15:48:50 +00:00
|
|
|
}
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2008-08-27 15:48:50 +00:00
|
|
|
// add the explosion
|
2010-05-29 07:25:38 +00:00
|
|
|
CParticle p;
|
|
|
|
p.SetDefault();
|
|
|
|
p.m_Spr = SPRITE_PART_EXPL01;
|
|
|
|
p.m_Pos = Pos;
|
|
|
|
p.m_LifeSpan = 0.4f;
|
|
|
|
p.m_StartSize = 150.0f;
|
|
|
|
p.m_EndSize = 0;
|
2021-01-12 18:25:20 +00:00
|
|
|
p.m_Rot = random_float() * pi * 2;
|
2021-07-12 09:43:56 +00:00
|
|
|
m_pClient->m_Particles.Add(CParticles::GROUP_EXPLOSIONS, &p);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2008-08-27 15:48:50 +00:00
|
|
|
// add the smoke
|
|
|
|
for(int i = 0; i < 24; i++)
|
|
|
|
{
|
2010-05-29 07:25:38 +00:00
|
|
|
CParticle p;
|
|
|
|
p.SetDefault();
|
|
|
|
p.m_Spr = SPRITE_PART_SMOKE;
|
|
|
|
p.m_Pos = Pos;
|
2021-01-12 18:25:20 +00:00
|
|
|
p.m_Vel = RandomDir() * ((1.0f + random_float() * 0.2f) * 1000.0f);
|
|
|
|
p.m_LifeSpan = 0.5f + random_float() * 0.4f;
|
|
|
|
p.m_StartSize = 32.0f + random_float() * 8;
|
2010-05-29 07:25:38 +00:00
|
|
|
p.m_EndSize = 0;
|
2021-01-12 18:25:20 +00:00
|
|
|
p.m_Gravity = random_float() * -800.0f;
|
2010-05-29 07:25:38 +00:00
|
|
|
p.m_Friction = 0.4f;
|
2021-01-12 18:25:20 +00:00
|
|
|
p.m_Color = mix(vec4(0.75f, 0.75f, 0.75f, 1.0f), vec4(0.5f, 0.5f, 0.5f, 1.0f), random_float());
|
2021-07-12 09:43:56 +00:00
|
|
|
m_pClient->m_Particles.Add(CParticles::GROUP_GENERAL, &p);
|
2008-08-27 15:48:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void CEffects::HammerHit(vec2 Pos)
|
2008-10-17 11:23:21 +00:00
|
|
|
{
|
|
|
|
// add the explosion
|
2010-05-29 07:25:38 +00:00
|
|
|
CParticle p;
|
|
|
|
p.SetDefault();
|
2011-04-08 17:11:41 +00:00
|
|
|
p.m_Spr = SPRITE_PART_HIT01;
|
2010-05-29 07:25:38 +00:00
|
|
|
p.m_Pos = Pos;
|
2011-04-08 17:11:41 +00:00
|
|
|
p.m_LifeSpan = 0.3f;
|
|
|
|
p.m_StartSize = 120.0f;
|
2010-05-29 07:25:38 +00:00
|
|
|
p.m_EndSize = 0;
|
2021-01-12 18:25:20 +00:00
|
|
|
p.m_Rot = random_float() * pi * 2;
|
2021-07-12 09:43:56 +00:00
|
|
|
m_pClient->m_Particles.Add(CParticles::GROUP_EXPLOSIONS, &p);
|
2014-10-25 00:52:08 +00:00
|
|
|
if(g_Config.m_SndGame)
|
2021-07-12 09:43:56 +00:00
|
|
|
m_pClient->m_Sounds.PlayAt(CSounds::CHN_WORLD, SOUND_HAMMER_HIT, 1.0f, Pos);
|
2008-10-17 11:23:21 +00:00
|
|
|
}
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void CEffects::OnRender()
|
2008-08-27 15:48:50 +00:00
|
|
|
{
|
2021-06-23 05:05:49 +00:00
|
|
|
static int64_t LastUpdate100hz = 0;
|
|
|
|
static int64_t LastUpdate50hz = 0;
|
2008-08-27 15:48:50 +00:00
|
|
|
|
2010-10-19 11:37:36 +00:00
|
|
|
if(Client()->State() == IClient::STATE_DEMOPLAYBACK)
|
|
|
|
{
|
|
|
|
const IDemoPlayer::CInfo *pInfo = DemoPlayer()->BaseInfo();
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2020-09-26 19:41:58 +00:00
|
|
|
if(time() - LastUpdate100hz > time_freq() / (100 * pInfo->m_Speed))
|
2010-10-19 11:37:36 +00:00
|
|
|
{
|
|
|
|
m_Add100hz = true;
|
2016-08-30 23:39:59 +00:00
|
|
|
LastUpdate100hz = time();
|
2010-10-19 11:37:36 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
m_Add100hz = false;
|
|
|
|
|
2020-09-26 19:41:58 +00:00
|
|
|
if(time() - LastUpdate50hz > time_freq() / (100 * pInfo->m_Speed))
|
2010-10-19 11:37:36 +00:00
|
|
|
{
|
|
|
|
m_Add50hz = true;
|
2016-08-30 23:39:59 +00:00
|
|
|
LastUpdate50hz = time();
|
2010-10-19 11:37:36 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
m_Add50hz = false;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-10-19 11:37:36 +00:00
|
|
|
if(m_Add50hz)
|
2021-07-12 09:43:56 +00:00
|
|
|
m_pClient->m_Flow.Update();
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-10-19 11:37:36 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2020-09-26 19:41:58 +00:00
|
|
|
if(time() - LastUpdate100hz > time_freq() / 100)
|
2008-08-27 15:48:50 +00:00
|
|
|
{
|
2010-05-29 07:25:38 +00:00
|
|
|
m_Add100hz = true;
|
2016-08-30 23:39:59 +00:00
|
|
|
LastUpdate100hz = time();
|
2008-08-27 15:48:50 +00:00
|
|
|
}
|
|
|
|
else
|
2010-05-29 07:25:38 +00:00
|
|
|
m_Add100hz = false;
|
2008-08-27 15:48:50 +00:00
|
|
|
|
2020-09-26 19:41:58 +00:00
|
|
|
if(time() - LastUpdate50hz > time_freq() / 100)
|
2008-08-27 15:48:50 +00:00
|
|
|
{
|
2010-05-29 07:25:38 +00:00
|
|
|
m_Add50hz = true;
|
2016-08-30 23:39:59 +00:00
|
|
|
LastUpdate50hz = time();
|
2008-08-27 15:48:50 +00:00
|
|
|
}
|
|
|
|
else
|
2010-05-29 07:25:38 +00:00
|
|
|
m_Add50hz = false;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
if(m_Add50hz)
|
2021-07-12 09:43:56 +00:00
|
|
|
m_pClient->m_Flow.Update();
|
2008-08-27 15:48:50 +00:00
|
|
|
}
|