Skip to content

Commit f741b3d

Browse files
committed
Update EW hud position on think
now you can see it when you crouch! :D
1 parent ae0665c commit f741b3d

4 files changed

Lines changed: 22 additions & 0 deletions

File tree

CS2Fixes.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@
247247
<ClInclude Include="src\cs2_sdk\entity\cmathcounter.h" />
248248
<ClInclude Include="src\cs2_sdk\entity\cparticlesystem.h" />
249249
<ClInclude Include="src\cs2_sdk\entity\cphysthruster.h" />
250+
<ClInclude Include="src\cs2_sdk\entity\cpointorient.h" />
250251
<ClInclude Include="src\cs2_sdk\entity\cpointviewcontrol.h" />
251252
<ClInclude Include="src\cs2_sdk\entity\cpointworldtext.h" />
252253
<ClInclude Include="src\cs2_sdk\entity\ctakedamageinfo.h" />

CS2Fixes.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,5 +415,8 @@
415415
<ClInclude Include="src\utils\hud_manager.h">
416416
<Filter>Header Files\utils</Filter>
417417
</ClInclude>
418+
<ClInclude Include="src\cs2_sdk\entity\cpointorient.h">
419+
<Filter>Header Files\cs2_sdk\entity</Filter>
420+
</ClInclude>
418421
</ItemGroup>
419422
</Project>

src/entwatch.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ using ordered_json = nlohmann::ordered_json;
4545

4646
#define EW_HUD_TICKRATE 0.5f
4747

48+
extern CConVar<bool> g_cvarEnableEntWatch;
49+
extern CConVar<bool> g_cvarEnableEntwatchHud;
50+
4851
enum EWHandlerType
4952
{
5053
Type_None,

src/playermanager.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,21 @@ void CPlayerManager::UpdatePlayerStates()
10611061
pClient->ForceFullUpdate();
10621062
}
10631063
}
1064+
1065+
// Update entwatch hud position
1066+
if (g_cvarEnableEntWatch.Get() && g_cvarEnableEntwatchHud.Get())
1067+
{
1068+
CCSPlayerPawn* pPawn = pController->GetPlayerPawn();
1069+
if (!pPawn)
1070+
continue;
1071+
1072+
CPointOrient* pOrient = pPlayer->GetPointOrient();
1073+
if (pOrient)
1074+
{
1075+
Vector origin = pPawn->GetEyePosition();
1076+
pOrient->Teleport(&origin, nullptr, nullptr);
1077+
}
1078+
}
10641079
}
10651080
}
10661081

0 commit comments

Comments
 (0)