Skip to content

Commit

Permalink
hookline tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
sjrc6 committed Mar 31, 2022
1 parent 99cd0e9 commit 0c50df3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/game/client/components/hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,17 @@ void CHud::RenderTextInfo()
str_format(aBuf, sizeof(aBuf), "%d", Client()->GetPredictionTime());
TextRender()->Text(0, m_Width - 10 - TextRender()->TextWidth(0, 12, aBuf, -1, -1.0f), g_Config.m_ClShowfps ? 20 : 5, 12, aBuf, -1.0f);
}

//vec2 ExDirection1;
//vec2 ExDirection2;
//ExDirection1 = normalize(vec2((int)m_pClient->m_Controls.m_MousePos[g_Config.m_ClDummy].x, (int)m_pClient->m_Controls.m_MousePos[g_Config.m_ClDummy].y));
//ExDirection2 = normalize(vec2(m_pClient->m_Controls.m_InputData[g_Config.m_ClDummy].m_TargetX, m_pClient->m_Controls.m_InputData[g_Config.m_ClDummy].m_TargetY));
//char aBuf[64];
//str_format(aBuf, sizeof(aBuf), "%.26f %.26f", ExDirection1.x, ExDirection1.y);
//TextRender()->Text(0, m_Width / 2 - TextRender()->TextWidth(0, 10, aBuf, -1, -1.0f) / 2, 20, 10, aBuf, -1.0f);
//str_format(aBuf, sizeof(aBuf), "%.26f %.26f", ExDirection2.x, ExDirection2.y);
//TextRender()->Text(0, m_Width / 2 - TextRender()->TextWidth(0, 10, aBuf, -1, -1.0f) / 2, 40, 10, aBuf, -1.0f);

//render team in freeze text
if((g_Config.m_ClShowFrozenText > 0 || g_Config.m_ClShowFrozenHud > 0) && GameClient()->m_GameInfo.m_EntitiesDDRace)
{
Expand Down
7 changes: 7 additions & 0 deletions src/game/client/components/players.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,14 @@ void CPlayers::RenderHookCollLine(
vec2 ExDirection = Direction;

if(Local && Client()->State() != IClient::STATE_DEMOPLAYBACK)
{
ExDirection = normalize(vec2((int)m_pClient->m_Controls.m_MousePos[g_Config.m_ClDummy].x, (int)m_pClient->m_Controls.m_MousePos[g_Config.m_ClDummy].y));

if(!(int)m_pClient->m_Controls.m_MousePos[g_Config.m_ClDummy].x && !(int)m_pClient->m_Controls.m_MousePos[g_Config.m_ClDummy].y)
{
ExDirection = vec2(1, 0);
}
}

bool AlwaysRenderHookColl = GameClient()->m_GameInfo.m_AllowHookColl && (Local ? g_Config.m_ClShowHookCollOwn : g_Config.m_ClShowHookCollOther) == 2;
bool RenderHookCollPlayer = ClientID >= 0 && Player.m_PlayerFlags & PLAYERFLAG_AIM && (Local ? g_Config.m_ClShowHookCollOwn : g_Config.m_ClShowHookCollOther) > 0;
Expand Down

0 comments on commit 0c50df3

Please sign in to comment.