diff --git a/src/engine/shared/config_variables.h b/src/engine/shared/config_variables.h index 02849f17c50..b1e1b126876 100644 --- a/src/engine/shared/config_variables.h +++ b/src/engine/shared/config_variables.h @@ -73,6 +73,7 @@ MACRO_CONFIG_INT(ClShowfps, cl_showfps, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, MACRO_CONFIG_INT(ClShowpred, cl_showpred, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show ingame prediction time in milliseconds") MACRO_CONFIG_INT(ClEyeWheel, cl_eye_wheel, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show eye wheel along together with emotes") MACRO_CONFIG_INT(ClEyeDuration, cl_eye_duration, 999999, 1, 999999, CFGFLAG_CLIENT | CFGFLAG_SAVE, "How long the eyes emotes last") +MACRO_CONFIG_INT(ClFreezeStars, cl_freeze_stars, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show old star particles for frozen tees") MACRO_CONFIG_INT(ClAirjumpindicator, cl_airjumpindicator, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show the air jump indicator") MACRO_CONFIG_INT(ClThreadsoundloading, cl_threadsoundloading, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Load sound files threaded") diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 5ac98249a97..a803acd306f 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -2071,6 +2071,33 @@ void CGameClient::OnNewSnapshot() m_Effects.AirJump(Pos, Alpha); } + if(g_Config.m_ClFreezeStars) + { + for(auto &m_aCharacter : m_Snap.m_aCharacters) + { + if(m_aCharacter.m_Active && m_aCharacter.m_HasExtendedData && m_aCharacter.m_PrevExtendedData) + { + int FreezeTimeNow = m_aCharacter.m_ExtendedData.m_FreezeEnd - Client()->GameTick(g_Config.m_ClDummy); + int FreezeTimePrev = m_aCharacter.m_PrevExtendedData->m_FreezeEnd - Client()->PrevGameTick(g_Config.m_ClDummy); + vec2 Pos = vec2(m_aCharacter.m_Cur.m_X, m_aCharacter.m_Cur.m_Y); + int StarsNow = (FreezeTimeNow + 1) / Client()->GameTickSpeed(); + int StarsPrev = (FreezeTimePrev + 1) / Client()->GameTickSpeed(); + if(StarsNow < StarsPrev || (StarsPrev == 0 && StarsNow > 0)) + { + int Amount = StarsNow + 1; + float a = 3 * pi / 2; + float s = a - pi / 3; + float e = a + pi / 3; + for(int j = 0; j < Amount; j++) + { + float f = mix(s, e, (j + 1) / (float)(Amount + 2)); + vec2 Dir = vec2(std::cos(f), std::sin(f)); + m_Effects.DamageIndicator(Pos, Dir); + } + } + } + } + } if(m_Snap.m_LocalClientId != m_PrevLocalId) m_PredictedDummyId = m_PrevLocalId; m_PrevLocalId = m_Snap.m_LocalClientId;