mirror of
https://github.com/rei-2/Amalgam
synced 2026-10-10 04:43:09 +08:00
update & fixes
menu search notification position & time party detection backend var changes (and some renames, sorry) wow fat commit
This commit is contained in:
@@ -878,6 +878,7 @@
|
||||
<ClCompile Include="src\Features\Visuals\ESP\ESP.cpp" />
|
||||
<ClCompile Include="src\Features\Visuals\FakeAngle\FakeAngle.cpp" />
|
||||
<ClCompile Include="src\Features\Visuals\Glow\Glow.cpp" />
|
||||
<ClCompile Include="src\Features\Visuals\Groups\Groups.cpp" />
|
||||
<ClCompile Include="src\Features\Visuals\PlayerConditions\PlayerConditions.cpp" />
|
||||
<ClCompile Include="src\Features\Visuals\Materials\Materials.cpp" />
|
||||
<ClCompile Include="src\Features\Visuals\Notifications\Notifications.cpp" />
|
||||
@@ -921,7 +922,6 @@
|
||||
<ClCompile Include="src\Hooks\CL_ReadPackets.cpp" />
|
||||
<ClCompile Include="src\Hooks\CMatchInviteNotification_OnTick.cpp" />
|
||||
<ClCompile Include="src\Hooks\CMaterial_Uncache.cpp" />
|
||||
<ClCompile Include="src\Hooks\CTFScatterGun_FireBullet.cpp" />
|
||||
<ClCompile Include="src\Hooks\IEngineTrace_SetTraceEntity.cpp" />
|
||||
<ClCompile Include="src\Hooks\CNetChannel_SendDatagram.cpp" />
|
||||
<ClCompile Include="src\Hooks\CNetChannel_SendNetMsg.cpp" />
|
||||
@@ -1172,6 +1172,7 @@
|
||||
<ClInclude Include="src\Features\Visuals\ESP\ESP.h" />
|
||||
<ClInclude Include="src\Features\Visuals\FakeAngle\FakeAngle.h" />
|
||||
<ClInclude Include="src\Features\Visuals\Glow\Glow.h" />
|
||||
<ClInclude Include="src\Features\Visuals\Groups\Groups.h" />
|
||||
<ClInclude Include="src\Features\Visuals\PlayerConditions\PlayerConditions.h" />
|
||||
<ClInclude Include="src\Features\Visuals\PlayerArrows\PlayerArrows.h" />
|
||||
<ClInclude Include="src\Features\Visuals\Radar\Radar.h" />
|
||||
|
||||
@@ -192,8 +192,8 @@
|
||||
<ClCompile Include="src\Features\Output\Output.cpp" />
|
||||
<ClCompile Include="src\Hooks\Cbuf_ExecuteCommand.cpp" />
|
||||
<ClCompile Include="src\Hooks\IEngineTrace_SetTraceEntity.cpp" />
|
||||
<ClCompile Include="src\Hooks\CTFScatterGun_FireBullet.cpp" />
|
||||
<ClCompile Include="src\Hooks\IMatSystemSurface_OnScreenSizeChanged.cpp" />
|
||||
<ClCompile Include="src\Features\Visuals\Groups\Groups.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\Utils\UtlVector\UtlVector.h" />
|
||||
@@ -575,6 +575,7 @@
|
||||
<ClInclude Include="src\SDK\Definitions\Misc\IMatchGroupDescription.h" />
|
||||
<ClInclude Include="src\Features\Output\Output.h" />
|
||||
<ClInclude Include="src\SDK\Definitions\Main\PlayerStats.h" />
|
||||
<ClInclude Include="src\Features\Visuals\Groups\Groups.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="cpp.hint" />
|
||||
|
||||
@@ -1186,7 +1186,9 @@ enum ImGuiInputTextFlags_
|
||||
ImGuiInputTextFlags_CallbackCharFilter = 1 << 21, // Callback on character inputs to replace or discard them. Modify 'EventChar' to replace or discard, or return 1 in callback to discard.
|
||||
ImGuiInputTextFlags_CallbackResize = 1 << 22, // Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow. Notify when the string wants to be resized (for string types which hold a cache of their Size). You will be provided a new BufSize in the callback and NEED to honor it. (see misc/cpp/imgui_stdlib.h for an example of using this)
|
||||
ImGuiInputTextFlags_CallbackEdit = 1 << 23, // Callback on any edit. Note that InputText() already returns true on edit + you can always use IsItemEdited(). The callback is useful to manipulate the underlying buffer while focus is active.
|
||||
|
||||
|
||||
ImGuiInputTextFlags_NoKeyboardNavigate = 1 << 24, // Pressing TAB no focuss..
|
||||
|
||||
// Obsolete names
|
||||
//ImGuiInputTextFlags_AlwaysInsertMode = ImGuiInputTextFlags_AlwaysOverwrite // [renamed in 1.82] name was not matching behavior
|
||||
};
|
||||
@@ -1764,8 +1766,6 @@ enum ImGuiColorEditFlags_
|
||||
|
||||
// User Options (right-click on widget to change some of them).
|
||||
ImGuiColorEditFlags_AlphaBar = 1 << 16, // // ColorEdit, ColorPicker: show vertical alpha bar/gradient in picker.
|
||||
ImGuiColorEditFlags_Round = 1 << 17, // // ColorEdit, ColorPicker: rouund.
|
||||
ImGuiColorEditFlags_LargeAlphaGrid = 1 << 18, // // ColorEdit, ColorPicker: large.
|
||||
ImGuiColorEditFlags_HDR = 1 << 19, // // (WIP) ColorEdit: Currently only disable 0.0f..1.0f limits in RGBA edition (note: you probably want to use ImGuiColorEditFlags_Float flag as well).
|
||||
ImGuiColorEditFlags_DisplayRGB = 1 << 20, // [Display] // ColorEdit: override _display_ type among RGB/HSV/Hex. ColorPicker: select any combination using one or more of RGB/HSV/Hex.
|
||||
ImGuiColorEditFlags_DisplayHSV = 1 << 21, // [Display] // "
|
||||
@@ -1776,6 +1776,10 @@ enum ImGuiColorEditFlags_
|
||||
ImGuiColorEditFlags_PickerHueWheel = 1 << 26, // [Picker] // ColorPicker: wheel for Hue, triangle for Sat/Value.
|
||||
ImGuiColorEditFlags_InputRGB = 1 << 27, // [Input] // ColorEdit, ColorPicker: input and output data in RGB format.
|
||||
ImGuiColorEditFlags_InputHSV = 1 << 28, // [Input] // ColorEdit, ColorPicker: input and output data in HSV format.
|
||||
|
||||
ImGuiColorEditFlags_LargeAlphaGrid = 1 << 29, // // ColorEdit, ColorPicker: large.
|
||||
ImGuiColorEditFlags_Round = 1 << 30, // // ColorEdit, ColorPicker: rouund.
|
||||
ImGuiColorEditFlags_NoRoundRestrict = 1 << 31, // // ColorEdit, ColorPicker: semi...round...
|
||||
|
||||
// Defaults Options. You can set application defaults using SetColorEditOptions(). The intent is that you probably don't want to
|
||||
// override them in most of your calls. Let the user choose via the option menu and/or call SetColorEditOptions() once during startup.
|
||||
|
||||
@@ -4523,7 +4523,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
||||
if (is_resizable)
|
||||
IM_ASSERT(callback != NULL); // Must provide a callback if you set the ImGuiInputTextFlags_CallbackResize flag!
|
||||
|
||||
const bool input_requested_by_nav = (g.ActiveId != id) && ((g.NavActivateId == id) && ((g.NavActivateFlags & ImGuiActivateFlags_PreferInput) || (g.NavInputSource == ImGuiInputSource_Keyboard)));
|
||||
const bool input_requested_by_nav = (g.ActiveId != id) && ((g.NavActivateId == id) && ((g.NavActivateFlags & ImGuiActivateFlags_PreferInput) || (g.NavInputSource == ImGuiInputSource_Keyboard))) && !(flags & ImGuiInputTextFlags_NoKeyboardNavigate);
|
||||
|
||||
const bool user_clicked = hovered && io.MouseClicked[0];
|
||||
const bool user_scroll_finish = is_multiline && state != NULL && g.ActiveId == 0 && g.ActiveIdPreviousFrame == GetWindowScrollbarID(draw_window, ImGuiAxis_Y);
|
||||
@@ -6134,7 +6134,7 @@ bool ImGui::ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFl
|
||||
|
||||
ImVec4 col_rgb_without_alpha(col_rgb.x, col_rgb.y, col_rgb.z, 1.0f);
|
||||
float grid_step = ImMin(size.x, size.y) / (flags & ImGuiColorEditFlags_LargeAlphaGrid ? 2.f : 2.99f);
|
||||
float rounding = flags & ImGuiColorEditFlags_Round ? ImMin(size_arg.x, size_arg.y) * 0.5f : ImMin(g.Style.FrameRounding, grid_step * 0.5f);
|
||||
float rounding = flags & ImGuiColorEditFlags_Round ? ImMin(size_arg.x, size_arg.y) * 0.5f : flags & ImGuiColorEditFlags_NoRoundRestrict ? g.Style.FrameRounding : ImMin(g.Style.FrameRounding, grid_step * 0.5f);
|
||||
ImRect bb_inner = bb;
|
||||
float off = 0.0f;
|
||||
if ((flags & ImGuiColorEditFlags_NoBorder) == 0)
|
||||
|
||||
+22
-18
@@ -103,17 +103,19 @@ void CCore::Unload()
|
||||
{
|
||||
if (m_bFailed)
|
||||
{
|
||||
ssFailStream << "\nCtrl + C to copy. Logged to Amalgam\\fail_log.txt. (1)\n";
|
||||
ssFailStream << "Built @ " __DATE__ ", " __TIME__;
|
||||
ssFailStream << "\nBuilt @ " __DATE__ ", " __TIME__ " (1)\n";
|
||||
ssFailStream << "Ctrl + C to copy. \n";
|
||||
try
|
||||
{
|
||||
std::ofstream file;
|
||||
file.open(F::Configs.m_sConfigPath + "fail_log.txt", std::ios_base::app);
|
||||
file << ssFailStream.str() + "\n\n\n";
|
||||
file.close();
|
||||
ssFailStream << "Logged to Amalgam\\fail_log.txt. ";
|
||||
}
|
||||
catch (...) {}
|
||||
|
||||
SDK::Output("Failed to load", ssFailStream.str().c_str(), {}, false, true, false, false, false, false, MB_OK | MB_ICONERROR);
|
||||
|
||||
ssFailStream << "\n\n\n\n";
|
||||
std::ofstream file;
|
||||
file.open(F::Configs.m_sConfigPath + "fail_log.txt", std::ios_base::app);
|
||||
file << ssFailStream.str();
|
||||
file.close();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -142,17 +144,19 @@ void CCore::Unload()
|
||||
|
||||
if (m_bFailed2)
|
||||
{
|
||||
ssFailStream << "\nCtrl + C to copy. Logged to Amalgam\\fail_log.txt. (2)\n";
|
||||
ssFailStream << "Built @ " __DATE__ ", " __TIME__;
|
||||
ssFailStream << "\nBuilt @ " __DATE__ ", " __TIME__ " (2)\n";
|
||||
ssFailStream << "Ctrl + C to copy. \n";
|
||||
try
|
||||
{
|
||||
std::ofstream file;
|
||||
file.open(F::Configs.m_sConfigPath + "fail_log.txt", std::ios_base::app);
|
||||
file << ssFailStream.str() + "\n\n\n";
|
||||
file.close();
|
||||
ssFailStream << "Logged to Amalgam\\fail_log.txt. ";
|
||||
}
|
||||
catch (...) {}
|
||||
|
||||
SDK::Output("Failed to load", ssFailStream.str().c_str(), {}, false, true, false, false, false, false, MB_OK | MB_ICONERROR);
|
||||
|
||||
ssFailStream << "\n\n\n\n";
|
||||
std::ofstream file;
|
||||
file.open(F::Configs.m_sConfigPath + "fail_log.txt", std::ios_base::app);
|
||||
file << ssFailStream.str();
|
||||
file.close();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ bool CAimbotGlobal::ShouldIgnore(CBaseEntity* pEntity, CTFPlayer* pLocal, CTFWea
|
||||
if (Vars::Aimbot::General::Ignore.Value & Vars::Aimbot::General::IgnoreEnum::Friends && H::Entities.IsFriend(pPlayer->entindex())
|
||||
|| Vars::Aimbot::General::Ignore.Value & Vars::Aimbot::General::IgnoreEnum::Party && H::Entities.InParty(pPlayer->entindex())
|
||||
|| Vars::Aimbot::General::Ignore.Value & Vars::Aimbot::General::IgnoreEnum::Invulnerable && pPlayer->IsInvulnerable() && SDK::AttribHookValue(0, "crit_forces_victim_to_laugh", pWeapon) <= 0
|
||||
|| Vars::Aimbot::General::Ignore.Value & Vars::Aimbot::General::IgnoreEnum::Cloaked && pPlayer->IsInvisible() && pPlayer->GetInvisPercentage() >= Vars::Aimbot::General::IgnoreCloakPercentage.Value
|
||||
|| Vars::Aimbot::General::Ignore.Value & Vars::Aimbot::General::IgnoreEnum::Cloaked && pPlayer->IsInvisible() && pPlayer->GetInvisPercentage() >= Vars::Aimbot::General::IgnoreCloak.Value
|
||||
|| Vars::Aimbot::General::Ignore.Value & Vars::Aimbot::General::IgnoreEnum::DeadRinger && pPlayer->m_bFeignDeathReady()
|
||||
|| Vars::Aimbot::General::Ignore.Value & Vars::Aimbot::General::IgnoreEnum::Taunting && pPlayer->IsTaunting()
|
||||
|| Vars::Aimbot::General::Ignore.Value & Vars::Aimbot::General::IgnoreEnum::Disguised && pPlayer->InCond(TF_COND_DISGUISED))
|
||||
|
||||
@@ -572,7 +572,7 @@ int CAimbotHitscan::CanHit(Target_t& tTarget, CTFPlayer* pLocal, CTFWeaponBase*
|
||||
}
|
||||
}
|
||||
|
||||
nextTick:
|
||||
nextTick:
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -115,8 +115,8 @@ void CAimbotMelee::SimulatePlayers(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, st
|
||||
{
|
||||
// swing prediction / auto warp
|
||||
const int iSwingTicks = GetSwingTime(pWeapon);
|
||||
int iMax = (iDoubletapTicks && Vars::CL_Move::Doubletap::AntiWarp.Value && pLocal->m_hGroundEntity())
|
||||
? std::max(iSwingTicks - Vars::CL_Move::Doubletap::TickLimit.Value - 1, 0)
|
||||
int iMax = (iDoubletapTicks && Vars::Doubletap::AntiWarp.Value && pLocal->m_hGroundEntity())
|
||||
? std::max(iSwingTicks - Vars::Doubletap::TickLimit.Value - 1, 0)
|
||||
: std::max(iSwingTicks, iDoubletapTicks);
|
||||
|
||||
if ((Vars::Aimbot::Melee::SwingPrediction.Value || iDoubletapTicks) && pWeapon->m_flSmackTime() < 0.f && iMax)
|
||||
@@ -124,7 +124,7 @@ void CAimbotMelee::SimulatePlayers(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, st
|
||||
PlayerStorage tStorage;
|
||||
std::unordered_map<int, PlayerStorage> mStorage;
|
||||
|
||||
F::MoveSim.Initialize(pLocal, tStorage, false, iDoubletapTicks);
|
||||
F::MoveSim.Initialize(pLocal, tStorage, false, !iDoubletapTicks);
|
||||
for (auto& tTarget : vTargets)
|
||||
F::MoveSim.Initialize(tTarget.m_pEntity, mStorage[tTarget.m_pEntity->entindex()], false);
|
||||
|
||||
@@ -463,7 +463,7 @@ void CAimbotMelee::Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd
|
||||
return;
|
||||
|
||||
iDoubletapTicks = F::Ticks.GetTicks(pWeapon);
|
||||
const bool bShouldSwing = iDoubletapTicks <= (GetSwingTime(pWeapon) ? 14 : 0) || Vars::CL_Move::Doubletap::AntiWarp.Value && pLocal->m_hGroundEntity();
|
||||
const bool bShouldSwing = iDoubletapTicks <= (GetSwingTime(pWeapon) ? 14 : 0) || Vars::Doubletap::AntiWarp.Value && pLocal->m_hGroundEntity();
|
||||
|
||||
Vec3 vEyePos = pLocal->GetShootPos();
|
||||
std::unordered_map<int, std::deque<TickRecord>> pRecordMap;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,13 +4,14 @@
|
||||
#include "../AimbotGlobal/AimbotGlobal.h"
|
||||
|
||||
Enum(PointType, None = 0, Regular = 1 << 0, Obscured = 1 << 1, ObscuredExtra = 1 << 2, ObscuredMulti = 1 << 3)
|
||||
Enum(Calculated, Pending, Good, Time, Bad)
|
||||
|
||||
struct Solution_t
|
||||
{
|
||||
float m_flPitch = 0.f;
|
||||
float m_flYaw = 0.f;
|
||||
float m_flTime = 0.f;
|
||||
int m_iCalculated = 0;
|
||||
int m_iCalculated = CalculatedEnum::Pending;
|
||||
};
|
||||
struct Point_t
|
||||
{
|
||||
@@ -48,8 +49,11 @@ class CAimbotProjectile
|
||||
std::vector<Target_t> SortTargets(CTFPlayer* pLocal, CTFWeaponBase* pWeapon);
|
||||
|
||||
int GetHitboxPriority(int nHitbox, Target_t& tTarget, Info_t& tInfo);
|
||||
|
||||
std::unordered_map<int, Vec3> GetDirectPoints(Target_t& tTarget, Info_t& tInfo);
|
||||
std::vector<Point_t> GetSplashPoints(Target_t& tTarget, std::vector<std::pair<Vec3, int>>& vSpherePoints, Info_t& tInfo, int iSimTime);
|
||||
void SetupSplashPoints(Target_t& tTarget, std::vector<std::pair<Vec3, int>>& vSpherePoints, Info_t& tInfo, std::vector<std::pair<Vec3, Vec3>>& vSimplePoints);
|
||||
std::vector<Point_t> GetSplashPointsSimple(Target_t& tTarget, std::vector<std::pair<Vec3, Vec3>>& vSpherePoints, Info_t& tInfo, int iSimTime);
|
||||
|
||||
void CalculateAngle(const Vec3& vLocalPos, const Vec3& vTargetPos, Info_t& tInfo, int iSimTime, Solution_t& out, bool bAccuracy = true);
|
||||
bool TestAngle(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, Target_t& tTarget, Vec3& vPoint, Vec3& vAngles, int iSimTime, bool bSplash, bool* pHitSolid = nullptr, std::deque<Vec3>* pProjectilePath = nullptr);
|
||||
|
||||
@@ -102,7 +102,7 @@ static inline bool CheckEntities(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUse
|
||||
if (Vars::Aimbot::Projectile::AutoDetonate.Value & Vars::Aimbot::Projectile::AutoDetonateEnum::IgnoreCloak && pEntity->IsPlayer())
|
||||
{
|
||||
auto pPlayer = pEntity->As<CTFPlayer>();
|
||||
if (pPlayer->IsInvisible() && pPlayer->GetInvisPercentage() >= Vars::Aimbot::General::IgnoreCloakPercentage.Value)
|
||||
if (pPlayer->IsInvisible() && pPlayer->GetInvisPercentage() >= Vars::Aimbot::General::IgnoreCloak.Value)
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ bool CAutoRocketJump::SetAngles(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUser
|
||||
{ // correct pitch
|
||||
Vec3 vShootPos = Math::RotatePoint(tProjInfo.m_vPos - vLocalPos, {}, { 0, -flYaw, 0 }); vShootPos.y = 0;
|
||||
Vec3 vTarget = Math::RotatePoint(vPoint - vLocalPos, {}, { 0, -flYaw, 0 });
|
||||
Vec3 vForward; Math::AngleVectors(tProjInfo.m_vAng - Vec3(0, flYaw, 0), &vForward); vForward.Normalize2D();
|
||||
Vec3 vForward; Math::AngleVectors(tProjInfo.m_vAng - Vec3(0, flYaw, 0), &vForward); vForward.y = 0; vForward.Normalize();
|
||||
float flA = 1.f;
|
||||
float flB = 2 * (vShootPos.x * vForward.x + vShootPos.z * vForward.z);
|
||||
float flC = (powf(vShootPos.x, 2) + powf(vShootPos.z, 2)) - (powf(vTarget.x, 2) + powf(vTarget.z, 2));
|
||||
|
||||
@@ -60,7 +60,7 @@ int CBacktrack::GetAnticipatedChoke(int iMethod)
|
||||
int iAnticipatedChoke = 0;
|
||||
if (F::Ticks.CanChoke() && G::PrimaryWeaponType != EWeaponType::HITSCAN && Vars::Aimbot::General::AimType.Value == Vars::Aimbot::General::AimTypeEnum::Silent)
|
||||
iAnticipatedChoke = 1;
|
||||
if (F::FakeLag.m_iGoal && !Vars::CL_Move::Fakelag::UnchokeOnAttack.Value && F::Ticks.m_iShiftedTicks == F::Ticks.m_iShiftedGoal && !F::Ticks.m_bDoubletap && !F::Ticks.m_bSpeedhack)
|
||||
if (F::FakeLag.m_iGoal && !Vars::Fakelag::UnchokeOnAttack.Value && F::Ticks.m_iShiftedTicks == F::Ticks.m_iShiftedGoal && !F::Ticks.m_bDoubletap && !F::Ticks.m_bSpeedhack)
|
||||
iAnticipatedChoke = F::FakeLag.m_iGoal - I::ClientState->chokedcommands; // iffy, unsure if there is a good way to get it to work well without unchoking
|
||||
return iAnticipatedChoke;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
}
|
||||
#define SetT(type, cond) if (IsType(type)) SetType(type, cond)
|
||||
|
||||
static inline void SetVars(int iBind, std::vector<CVarBase*>& vVars = G::Vars)
|
||||
static inline void SetVars(int iBind, std::vector<BaseVar*>& vVars = G::Vars)
|
||||
{
|
||||
const bool bDefault = iBind == DEFAULT_BIND;
|
||||
for (auto pVar : vVars)
|
||||
|
||||
@@ -26,7 +26,7 @@ struct Bind_t
|
||||
|
||||
int m_iParent = -1;
|
||||
|
||||
std::vector<CVarBase*> m_vVars = {};
|
||||
std::vector<BaseVar*> m_vVars = {};
|
||||
};
|
||||
|
||||
class CBinds
|
||||
|
||||
@@ -6,24 +6,24 @@
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
#include <boost/algorithm/string/join.hpp>
|
||||
|
||||
bool CCommands::Run(const std::string& cmd, std::deque<std::string>& args)
|
||||
bool CCommands::Run(const std::string& sCmd, std::deque<std::string>& vArgs)
|
||||
{
|
||||
auto uHash = FNV1A::Hash32(cmd.c_str());
|
||||
if (!CommandMap.contains(uHash))
|
||||
auto uHash = FNV1A::Hash32(sCmd.c_str());
|
||||
if (!m_mCommands.contains(uHash))
|
||||
return false;
|
||||
|
||||
CommandMap[uHash](args);
|
||||
m_mCommands[uHash](vArgs);
|
||||
return true;
|
||||
}
|
||||
|
||||
void CCommands::Register(const std::string& name, CommandCallback callback)
|
||||
void CCommands::Register(const std::string& sName, CommandCallback fCallback)
|
||||
{
|
||||
CommandMap[FNV1A::Hash32(name.c_str())] = std::move(callback);
|
||||
m_mCommands[FNV1A::Hash32(sName.c_str())] = std::move(fCallback);
|
||||
}
|
||||
|
||||
void CCommands::Initialize()
|
||||
{
|
||||
Register("queue", [](const std::deque<std::string>& args)
|
||||
Register("queue", [](const std::deque<std::string>& vArgs)
|
||||
{
|
||||
static bool bHasLoaded = false;
|
||||
if (!bHasLoaded)
|
||||
@@ -34,57 +34,71 @@ void CCommands::Initialize()
|
||||
I::TFPartyClient->RequestQueueForMatch(k_eTFMatchGroup_Casual_Default);
|
||||
});
|
||||
|
||||
Register("setcvar", [](const std::deque<std::string>& args)
|
||||
Register("setcvar", [](const std::deque<std::string>& vArgs)
|
||||
{
|
||||
if (args.size() < 2)
|
||||
if (vArgs.size() < 2)
|
||||
{
|
||||
SDK::Output("Usage:\n\tsetcvar <cvar> <value>");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto foundCVar = I::CVar->FindVar(args[0].c_str());
|
||||
const std::string cvarName = args[0];
|
||||
if (!foundCVar)
|
||||
std::string sCVar = vArgs[0];
|
||||
auto pCVar = I::CVar->FindVar(sCVar.c_str());
|
||||
if (!pCVar)
|
||||
{
|
||||
SDK::Output(std::format("Could not find {}", cvarName).c_str());
|
||||
SDK::Output(std::format("Could not find {}", sCVar).c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
auto vArgs = args; vArgs.pop_front();
|
||||
std::string newValue = boost::algorithm::join(vArgs, " ");
|
||||
boost::replace_all(newValue, "\"", "");
|
||||
foundCVar->SetValue(newValue.c_str());
|
||||
SDK::Output(std::format("Set {} to {}", cvarName, newValue).c_str());
|
||||
auto vArgs2 = vArgs; vArgs2.pop_front();
|
||||
std::string sValue = boost::algorithm::join(vArgs2, " ");
|
||||
boost::replace_all(sValue, "\"", "");
|
||||
pCVar->SetValue(sValue.c_str());
|
||||
SDK::Output(std::format("Set {} to {}", sCVar, sValue).c_str());
|
||||
});
|
||||
|
||||
Register("getcvar", [](const std::deque<std::string>& args)
|
||||
Register("getcvar", [](const std::deque<std::string>& vArgs)
|
||||
{
|
||||
if (args.size() != 1)
|
||||
if (vArgs.size() != 1)
|
||||
{
|
||||
SDK::Output("Usage:\n\tgetcvar <cvar>");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto foundCVar = I::CVar->FindVar(args[0].c_str());
|
||||
const std::string cvarName = args[0];
|
||||
if (!foundCVar)
|
||||
std::string sCVar = vArgs[0];
|
||||
auto pCVar = I::CVar->FindVar(sCVar.c_str());
|
||||
if (!pCVar)
|
||||
{
|
||||
SDK::Output(std::format("Could not find {}", cvarName).c_str());
|
||||
SDK::Output(std::format("Could not find {}", sCVar).c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
SDK::Output(std::format("Value of {} is {}", cvarName, foundCVar->GetString()).c_str());
|
||||
SDK::Output(std::format("Value of {} is {}", sCVar, pCVar->GetString()).c_str());
|
||||
});
|
||||
|
||||
Register("menu", [](const std::deque<std::string>& args)
|
||||
Register("menu", [](const std::deque<std::string>& vArgs)
|
||||
{
|
||||
I::MatSystemSurface->SetCursorAlwaysVisible(F::Menu.m_bIsOpen = !F::Menu.m_bIsOpen);
|
||||
});
|
||||
|
||||
Register("unload", [](const std::deque<std::string>& args)
|
||||
Register("unload", [](const std::deque<std::string>& vArgs)
|
||||
{
|
||||
if (F::Menu.m_bIsOpen)
|
||||
I::MatSystemSurface->SetCursorAlwaysVisible(F::Menu.m_bIsOpen = false);
|
||||
U::Core.m_bUnload = true;
|
||||
});
|
||||
|
||||
Register("crash", [](const std::deque<std::string>& vArgs) // if you want to time out of a server and rejoin
|
||||
{
|
||||
switch (vArgs.empty() ? 0 : FNV1A::Hash32(vArgs.front().c_str()))
|
||||
{
|
||||
case FNV1A::Hash32Const("true"):
|
||||
case FNV1A::Hash32Const("t"):
|
||||
case FNV1A::Hash32Const("1"):
|
||||
break;
|
||||
default:
|
||||
Vars::Debug::CrashLogging.Value = false; // we are voluntarily crashing, don't give out log if we don't want one
|
||||
}
|
||||
reinterpret_cast<void(*)()>(0)();
|
||||
});
|
||||
}
|
||||
@@ -7,12 +7,12 @@ using CommandCallback = std::function<void(std::deque<std::string>)>;
|
||||
class CCommands
|
||||
{
|
||||
private:
|
||||
std::unordered_map<uint32_t, CommandCallback> CommandMap;
|
||||
std::unordered_map<uint32_t, CommandCallback> m_mCommands;
|
||||
|
||||
public:
|
||||
void Initialize();
|
||||
bool Run(const std::string& cmd, std::deque<std::string>& args);
|
||||
void Register(const std::string& name, CommandCallback callback);
|
||||
bool Run(const std::string& sCmd, std::deque<std::string>& vArgs);
|
||||
void Register(const std::string& sName, CommandCallback fCallback);
|
||||
};
|
||||
|
||||
ADD_FEATURE(CCommands, Commands)
|
||||
@@ -265,13 +265,13 @@ CConfigs::CConfigs()
|
||||
boost::property_tree::ptree mapTree;\
|
||||
for (auto& [iBind, tValue] : pVar->As<type>()->Map)\
|
||||
SaveJson(mapTree, std::to_string(iBind), tValue);\
|
||||
tree.put_child(pVar->m_sName.c_str(), mapTree);\
|
||||
tree.put_child(pVar->m_sName, mapTree);\
|
||||
}
|
||||
#define SaveMain(type, tree) if (IsType(type)) SaveCond(type, tree)
|
||||
#define LoadCond(type, tree)\
|
||||
{\
|
||||
pVar->As<type>()->Map = { { DEFAULT_BIND, pVar->As<type>()->Default } };\
|
||||
if (const auto mapTree = tree.get_child_optional(pVar->m_sName.c_str()))\
|
||||
if (const auto mapTree = tree.get_child_optional(pVar->m_sName))\
|
||||
{\
|
||||
for (auto& it : *mapTree)\
|
||||
{\
|
||||
@@ -311,6 +311,8 @@ CConfigs::CConfigs()
|
||||
}\
|
||||
}\
|
||||
}\
|
||||
else if (!(pVar->m_iFlags & NOSAVE))\
|
||||
SDK::Output("Amalgam", std::format("{} not found", pVar->m_sName).c_str(), { 175, 150, 255, 127 }, true, true);\
|
||||
}
|
||||
#define LoadMain(type, tree) if (IsType(type)) LoadCond(type, tree)
|
||||
|
||||
@@ -370,7 +372,7 @@ bool CConfigs::SaveConfig(const std::string& sConfigName, bool bNotify)
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
SDK::Output("SaveConfig", "Failed", { 175, 150, 255 }, true, true);
|
||||
SDK::Output("Amalgam", "Save config failed", { 175, 150, 255, 127 }, true, true);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -485,16 +487,16 @@ bool CConfigs::LoadConfig(const std::string& sConfigName, bool bNotify)
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
SDK::Output("LoadConfig", "Failed", { 175, 150, 255 }, true, true);
|
||||
SDK::Output("Amalgam", "Load config failed", { 175, 150, 255, 127 }, true, true);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#define SaveRegular(type, tree) SaveJson(tree, pVar->m_sName.c_str(), pVar->As<type>()->Map[DEFAULT_BIND])
|
||||
#define SaveRegular(type, tree) SaveJson(tree, pVar->m_sName, pVar->As<type>()->Map[DEFAULT_BIND])
|
||||
#define SaveMisc(type, tree) if (IsType(type)) SaveRegular(type, tree);
|
||||
#define LoadRegular(type, tree) LoadJson(tree, pVar->m_sName.c_str(), pVar->As<type>()->Map[DEFAULT_BIND])
|
||||
#define LoadRegular(type, tree) LoadJson(tree, pVar->m_sName, pVar->As<type>()->Map[DEFAULT_BIND])
|
||||
#define LoadMisc(type, tree) if (IsType(type)) LoadRegular(type, tree);
|
||||
|
||||
bool CConfigs::SaveVisual(const std::string& sConfigName, bool bNotify)
|
||||
@@ -529,7 +531,7 @@ bool CConfigs::SaveVisual(const std::string& sConfigName, bool bNotify)
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
SDK::Output("SaveVisual", "Failed", { 175, 150, 255 }, true, true);
|
||||
SDK::Output("Amalgam", "Save visuals failed", { 175, 150, 255, 127 }, true, true);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -576,7 +578,7 @@ bool CConfigs::LoadVisual(const std::string& sConfigName, bool bNotify)
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
SDK::Output("LoadVisual", "Failed", { 175, 150, 255 }, true, true);
|
||||
SDK::Output("Amalgam", "Load visuals failed", { 175, 150, 255, 127 }, true, true);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -585,7 +587,7 @@ bool CConfigs::LoadVisual(const std::string& sConfigName, bool bNotify)
|
||||
#define ResetType(type) pVar->As<type>()->Map = { { DEFAULT_BIND, pVar->As<type>()->Default } };
|
||||
#define ResetT(type) if (IsType(type)) ResetType(type)
|
||||
|
||||
void CConfigs::RemoveConfig(const std::string& sConfigName, bool bNotify)
|
||||
void CConfigs::DeleteConfig(const std::string& sConfigName, bool bNotify)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -593,7 +595,8 @@ void CConfigs::RemoveConfig(const std::string& sConfigName, bool bNotify)
|
||||
{
|
||||
std::filesystem::remove(m_sConfigPath + sConfigName + m_sConfigExtension);
|
||||
|
||||
LoadConfig("default", false);
|
||||
if (FNV1A::Hash32(m_sCurrentConfig.c_str()) == FNV1A::Hash32(sConfigName.c_str()))
|
||||
LoadConfig("default", false);
|
||||
|
||||
if (bNotify)
|
||||
SDK::Output("Amalgam", std::format("Config {} deleted", sConfigName).c_str(), { 175, 150, 255 }, true, true, true);
|
||||
@@ -603,22 +606,7 @@ void CConfigs::RemoveConfig(const std::string& sConfigName, bool bNotify)
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
SDK::Output("RemoveConfig", "Failed", { 175, 150, 255 }, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
void CConfigs::RemoveVisual(const std::string& sConfigName, bool bNotify)
|
||||
{
|
||||
try
|
||||
{
|
||||
std::filesystem::remove(m_sVisualsPath + sConfigName + m_sConfigExtension);
|
||||
|
||||
if (bNotify)
|
||||
SDK::Output("Amalgam", std::format("Visual config {} deleted", sConfigName).c_str(), { 175, 150, 255 }, true, true, true);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
SDK::Output("RemoveVisual", "Failed", { 175, 150, 255 }, true, true);
|
||||
SDK::Output("Amalgam", "Remove config failed", { 175, 150, 255, 127 }, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -655,7 +643,22 @@ void CConfigs::ResetConfig(const std::string& sConfigName, bool bNotify)
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
SDK::Output("ResetConfig", "Failed", { 175, 150, 255 }, true, true);
|
||||
SDK::Output("Amalgam", "Reset config failed", { 175, 150, 255, 127 }, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
void CConfigs::DeleteVisual(const std::string& sConfigName, bool bNotify)
|
||||
{
|
||||
try
|
||||
{
|
||||
std::filesystem::remove(m_sVisualsPath + sConfigName + m_sConfigExtension);
|
||||
|
||||
if (bNotify)
|
||||
SDK::Output("Amalgam", std::format("Visual config {} deleted", sConfigName).c_str(), { 175, 150, 255 }, true, true, true);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
SDK::Output("Amalgam", "Remove visuals failed", { 175, 150, 255, 127 }, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -690,6 +693,6 @@ void CConfigs::ResetVisual(const std::string& sConfigName, bool bNotify)
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
SDK::Output("ResetVisual", "Failed", { 175, 150, 255 }, true, true);
|
||||
SDK::Output("Amalgam", "Reset visuals failed", { 175, 150, 255, 127 }, true, true);
|
||||
}
|
||||
}
|
||||
@@ -36,11 +36,11 @@ public:
|
||||
|
||||
bool SaveConfig(const std::string& sConfigName, bool bNotify = true);
|
||||
bool LoadConfig(const std::string& sConfigName, bool bNotify = true);
|
||||
void DeleteConfig(const std::string& sConfigName, bool bNotify = true);
|
||||
void ResetConfig(const std::string& sConfigName, bool bNotify = true);
|
||||
bool SaveVisual(const std::string& sConfigName, bool bNotify = true);
|
||||
bool LoadVisual(const std::string& sConfigName, bool bNotify = true);
|
||||
void RemoveConfig(const std::string& sConfigName, bool bNotify = true);
|
||||
void RemoveVisual(const std::string& sConfigName, bool bNotify = true);
|
||||
void ResetConfig(const std::string& sConfigName, bool bNotify = true);
|
||||
void DeleteVisual(const std::string& sConfigName, bool bNotify = true);
|
||||
void ResetVisual(const std::string& sConfigName, bool bNotify = true);
|
||||
|
||||
boost::property_tree::ptree ColorToTree(const Color_t& color);
|
||||
|
||||
@@ -268,6 +268,7 @@ bool CCritHack::WeaponCanCrit(CTFWeaponBase* pWeapon, bool bWeaponOnly)
|
||||
case TF_WEAPON_COMPOUND_BOW:
|
||||
case TF_WEAPON_JAR:
|
||||
case TF_WEAPON_KNIFE:
|
||||
case TF_WEAPON_PASSTIME_GUN:
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -363,7 +364,7 @@ void CCritHack::Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd)
|
||||
{
|
||||
if (bCanCrit && bPressed && iClosestCrit)
|
||||
pCmd->command_number = iClosestCrit;
|
||||
else if (Vars::CritHack::AvoidRandom.Value && iClosestSkip)
|
||||
else if (Vars::CritHack::AvoidRandomCrits.Value && iClosestSkip)
|
||||
pCmd->command_number = iClosestSkip;
|
||||
}
|
||||
else if (Vars::Misc::Game::AntiCheatCritHack.Value)
|
||||
@@ -372,7 +373,7 @@ void CCritHack::Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd)
|
||||
|
||||
bool bCritCommand = IsCritCommand(iSlot, tStorage.m_iEntIndex, tStorage.m_flMultCritChance, pCmd->command_number, true, false);
|
||||
if (bCanCrit && bPressed && !bCritCommand
|
||||
|| Vars::CritHack::AvoidRandom.Value && !bPressed && bCritCommand)
|
||||
|| Vars::CritHack::AvoidRandomCrits.Value && !bPressed && bCritCommand)
|
||||
bShouldAvoid = true;
|
||||
|
||||
if (bShouldAvoid)
|
||||
@@ -412,7 +413,7 @@ int CCritHack::PredictCmdNum(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd
|
||||
const bool bPressed = Vars::CritHack::ForceCrits.Value || pWeapon->GetSlot() == SLOT_MELEE && Vars::CritHack::AlwaysMeleeCrit.Value && (Vars::Aimbot::General::AutoShoot.Value ? pCmd->buttons & IN_ATTACK && !(G::OriginalMove.m_iButtons & IN_ATTACK) : Vars::Aimbot::General::AimType.Value);
|
||||
if (bCanCrit && bPressed && closestCrit)
|
||||
return closestCrit;
|
||||
else if (Vars::CritHack::AvoidRandom.Value && closestSkip)
|
||||
else if (Vars::CritHack::AvoidRandomCrits.Value && closestSkip)
|
||||
return closestSkip;
|
||||
|
||||
return pCmd->command_number;
|
||||
@@ -462,7 +463,16 @@ void CCritHack::Event(IGameEvent* pEvent, uint32_t uHash, CTFPlayer* pLocal)
|
||||
iDamage = std::min(iDamage, tHistory.m_iNewHealth);
|
||||
else if (pVictim && (pVictim->m_bFeignDeathReady() || pVictim->InCond(TF_COND_FEIGN_DEATH))) // damage number is spoofed upon sending, correct it
|
||||
{
|
||||
int iOldHealth = tHistory.m_mHistory.contains(iHealth) ? tHistory.m_mHistory[iHealth].m_iOldHealth : tHistory.m_iNewHealth;
|
||||
int iOldHealth = (tHistory.m_mHistory.contains(iHealth) ? tHistory.m_mHistory[iHealth].m_iOldHealth : tHistory.m_iNewHealth) % 32768;
|
||||
if (iHealth > iOldHealth)
|
||||
{
|
||||
for (auto& [_, tOldHealth] : tHistory.m_mHistory)
|
||||
{
|
||||
int iOldHealth2 = tOldHealth.m_iOldHealth % 32768;
|
||||
if (iOldHealth2 > iHealth)
|
||||
iOldHealth = iHealth > iOldHealth ? iOldHealth2 : std::min(iOldHealth, iOldHealth2);
|
||||
}
|
||||
}
|
||||
iDamage = std::clamp(iOldHealth - iHealth, 0, iDamage);
|
||||
}
|
||||
}
|
||||
@@ -537,11 +547,11 @@ void CCritHack::StoreHealthHistory(int iIndex, int iHealth, bool bDamage)
|
||||
tHistory = { iHealth, iHealth };
|
||||
else if (iHealth != tHistory.m_iNewHealth)
|
||||
{
|
||||
tHistory.m_iOldHealth = std::max(bDamage && tHistory.m_mHistory.contains(iHealth) ? tHistory.m_mHistory[iHealth].m_iOldHealth : tHistory.m_iNewHealth, iHealth);
|
||||
tHistory.m_iOldHealth = std::max(bDamage && tHistory.m_mHistory.contains(iHealth % 32768) ? tHistory.m_mHistory[iHealth % 32768].m_iOldHealth : tHistory.m_iNewHealth, iHealth);
|
||||
tHistory.m_iNewHealth = iHealth;
|
||||
}
|
||||
|
||||
tHistory.m_mHistory[tHistory.m_iNewHealth] = { tHistory.m_iOldHealth, float(SDK::PlatFloatTime()) };
|
||||
tHistory.m_mHistory[iHealth % 32768] = { tHistory.m_iOldHealth, float(SDK::PlatFloatTime()) };
|
||||
while (tHistory.m_mHistory.size() > 3)
|
||||
{
|
||||
int iIndex2; float flMin = std::numeric_limits<float>::max();
|
||||
@@ -594,7 +604,7 @@ void CCritHack::Draw(CTFPlayer* pLocal)
|
||||
}
|
||||
|
||||
auto iSlot = pWeapon->GetSlot();
|
||||
if (!m_mStorage.contains(iSlot) || !m_mStorage[iSlot].m_bActive)
|
||||
if (!m_mStorage.contains(iSlot) || !m_mStorage[iSlot].m_bActive || pWeapon->GetWeaponID() == TF_WEAPON_PASSTIME_GUN)
|
||||
return;
|
||||
else if (!WeaponCanCrit(pWeapon))
|
||||
{
|
||||
@@ -603,9 +613,6 @@ void CCritHack::Draw(CTFPlayer* pLocal)
|
||||
}
|
||||
|
||||
auto& tStorage = m_mStorage[iSlot];
|
||||
if (!tStorage.m_bActive)
|
||||
return;
|
||||
|
||||
auto bRapidFire = pWeapon->IsRapidFire();
|
||||
float flTickBase = TICKS_TO_TIME(pLocal->m_nTickBase());
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ void CEnginePrediction::Simulate(CTFPlayer* pLocal, CUserCmd* pCmd)
|
||||
I::Prediction->SetLocalViewAngles(pCmd->viewangles);
|
||||
|
||||
Vec2 vOriginalMove; int iOriginalButtons;
|
||||
if (m_bDoubletap = m_bInPrediction && (F::Ticks.m_bAntiWarp || F::Ticks.GetTicks(H::Entities.GetWeapon()) && Vars::CL_Move::Doubletap::AntiWarp.Value && pLocal->m_hGroundEntity()))
|
||||
if (m_bDoubletap = m_bInPrediction && (F::Ticks.m_bAntiWarp || F::Ticks.GetTicks(H::Entities.GetWeapon()) && Vars::Doubletap::AntiWarp.Value && pLocal->m_hGroundEntity()))
|
||||
{
|
||||
m_vOriginalOrigin = pLocal->m_vecOrigin();
|
||||
m_vOriginalVelocity = pLocal->m_vecVelocity();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+2467
-1870
File diff suppressed because it is too large
Load Diff
@@ -21,6 +21,7 @@ class CMenu
|
||||
void MenuMisc(int iTab);
|
||||
void MenuLogs(int iTab);
|
||||
void MenuSettings(int iTab);
|
||||
void MenuSearch(std::string sSearch);
|
||||
|
||||
void AddDraggable(const char* sLabel, ConfigVar<DragBox_t>& var, bool bShouldDraw = true, ImVec2 vSize = { H::Draw.Scale(100), H::Draw.Scale(40) });
|
||||
void AddResizableDraggable(const char* sLabel, ConfigVar<WindowBox_t>& var, bool bShouldDraw = true, ImVec2 vMinSize = { H::Draw.Scale(100), H::Draw.Scale(100) }, ImVec2 vMaxSize = { H::Draw.Scale(1000), H::Draw.Scale(1000) }, ImGuiSizeCallback fCustomCallback = nullptr);
|
||||
|
||||
@@ -132,19 +132,19 @@ void CRender::LoadStyle()
|
||||
style.ButtonTextAlign = { 0.5f, 0.5f }; // Center button text
|
||||
style.CellPadding = { H::Draw.Scale(4), 0 };
|
||||
style.ChildBorderSize = 0.f;
|
||||
style.ChildRounding = 0.f;
|
||||
style.ChildRounding = H::Draw.Scale(4);
|
||||
style.FrameBorderSize = 0.f;
|
||||
style.FramePadding = { 0, 0 };
|
||||
style.FrameRounding = H::Draw.Scale(3);
|
||||
style.FrameRounding = H::Draw.Scale(4);
|
||||
style.ItemInnerSpacing = { 0, 0 };
|
||||
style.ItemSpacing = { H::Draw.Scale(8), H::Draw.Scale(8) };
|
||||
style.PopupBorderSize = 0.f;
|
||||
style.PopupRounding = H::Draw.Scale(3);
|
||||
style.PopupRounding = H::Draw.Scale(4);
|
||||
style.ScrollbarSize = 6.f + H::Draw.Scale(3);
|
||||
style.ScrollbarRounding = 0.f;
|
||||
style.WindowBorderSize = 0.f;
|
||||
style.WindowPadding = { 0, 0 };
|
||||
style.WindowRounding = H::Draw.Scale(3);
|
||||
style.WindowRounding = H::Draw.Scale(4);
|
||||
}
|
||||
|
||||
void CRender::Initialize(IDirect3DDevice9* pDevice)
|
||||
@@ -154,6 +154,10 @@ void CRender::Initialize(IDirect3DDevice9* pDevice)
|
||||
ImGui_ImplWin32_Init(WndProc::hwWindow);
|
||||
ImGui_ImplDX9_Init(pDevice);
|
||||
|
||||
auto& io = ImGui::GetIO();
|
||||
io.IniFilename = nullptr;
|
||||
io.LogFilename = nullptr;
|
||||
|
||||
LoadFonts();
|
||||
LoadStyle();
|
||||
}
|
||||
@@ -36,6 +36,7 @@ void CMisc::RunPost(CTFPlayer* pLocal, CUserCmd* pCmd, bool pSendPacket)
|
||||
|
||||
EdgeJump(pLocal, pCmd, true);
|
||||
TauntKartControl(pLocal, pCmd);
|
||||
AutoPeek(pLocal, pCmd, true);
|
||||
FastMovement(pLocal, pCmd);
|
||||
}
|
||||
|
||||
@@ -142,46 +143,6 @@ void CMisc::AutoStrafe(CTFPlayer* pLocal, CUserCmd* pCmd)
|
||||
}
|
||||
}
|
||||
|
||||
void CMisc::AutoPeek(CTFPlayer* pLocal, CUserCmd* pCmd)
|
||||
{
|
||||
static bool bReturning = false;
|
||||
if (Vars::CL_Move::AutoPeek.Value)
|
||||
{
|
||||
const Vec3 vLocalPos = pLocal->m_vecOrigin();
|
||||
|
||||
if (G::Attacking && m_bPeekPlaced)
|
||||
bReturning = true;
|
||||
if (!bReturning && !pLocal->m_hGroundEntity())
|
||||
m_bPeekPlaced = false;
|
||||
|
||||
if (!m_bPeekPlaced)
|
||||
{
|
||||
m_vPeekReturnPos = vLocalPos;
|
||||
m_bPeekPlaced = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
static Timer tTimer = {};
|
||||
if (tTimer.Run(0.7f))
|
||||
H::Particles.DispatchParticleEffect("ping_circle", m_vPeekReturnPos, {});
|
||||
}
|
||||
|
||||
if (bReturning)
|
||||
{
|
||||
if (vLocalPos.DistTo(m_vPeekReturnPos) < 8.f)
|
||||
{
|
||||
bReturning = false;
|
||||
return;
|
||||
}
|
||||
|
||||
SDK::WalkTo(pCmd, pLocal, m_vPeekReturnPos);
|
||||
pCmd->buttons &= ~IN_JUMP;
|
||||
}
|
||||
}
|
||||
else
|
||||
m_bPeekPlaced = bReturning = false;
|
||||
}
|
||||
|
||||
void CMisc::MovementLock(CTFPlayer* pLocal, CUserCmd* pCmd)
|
||||
{
|
||||
static bool bLock = false;
|
||||
@@ -405,7 +366,7 @@ void CMisc::FastMovement(CTFPlayer* pLocal, CUserCmd* pCmd)
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
if ((pLocal->IsDucking() ? !Vars::Misc::Movement::CrouchSpeed.Value : !Vars::Misc::Movement::FastAccel.Value)
|
||||
if ((pLocal->IsDucking() ? !Vars::Misc::Movement::CrouchSpeed.Value : !Vars::Misc::Movement::FastAccelerate.Value)
|
||||
|| Vars::Misc::Game::AntiCheatCompatibility.Value
|
||||
|| G::Attacking == 1 || F::Ticks.m_bDoubletap || F::Ticks.m_bSpeedhack || F::Ticks.m_bRecharge || G::AntiAim || I::GlobalVars->tickcount % 2)
|
||||
return;
|
||||
@@ -427,6 +388,49 @@ void CMisc::FastMovement(CTFPlayer* pLocal, CUserCmd* pCmd)
|
||||
}
|
||||
}
|
||||
|
||||
void CMisc::AutoPeek(CTFPlayer* pLocal, CUserCmd* pCmd, bool bPost)
|
||||
{
|
||||
static bool bReturning = false;
|
||||
|
||||
if (!bPost)
|
||||
{
|
||||
if (Vars::AutoPeek::Enabled.Value)
|
||||
{
|
||||
Vec3 vLocalPos = pLocal->m_vecOrigin();
|
||||
|
||||
if (bReturning)
|
||||
{
|
||||
if (vLocalPos.DistTo(m_vPeekReturnPos) < 8.f)
|
||||
{
|
||||
bReturning = false;
|
||||
return;
|
||||
}
|
||||
|
||||
SDK::WalkTo(pCmd, pLocal, m_vPeekReturnPos);
|
||||
pCmd->buttons &= ~IN_JUMP;
|
||||
}
|
||||
else if (!pLocal->m_hGroundEntity())
|
||||
m_bPeekPlaced = false;
|
||||
|
||||
if (!m_bPeekPlaced)
|
||||
{
|
||||
m_vPeekReturnPos = vLocalPos;
|
||||
m_bPeekPlaced = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
static Timer tTimer = {};
|
||||
if (tTimer.Run(0.7f))
|
||||
H::Particles.DispatchParticleEffect("ping_circle", m_vPeekReturnPos, {});
|
||||
}
|
||||
}
|
||||
else
|
||||
m_bPeekPlaced = bReturning = false;
|
||||
}
|
||||
else if (G::Attacking && m_bPeekPlaced)
|
||||
bReturning = true;
|
||||
}
|
||||
|
||||
void CMisc::EdgeJump(CTFPlayer* pLocal, CUserCmd* pCmd, bool bPost)
|
||||
{
|
||||
if (!Vars::Misc::Movement::EdgeJump.Value)
|
||||
@@ -600,27 +604,27 @@ bool CMisc::SteamRPC()
|
||||
*/
|
||||
|
||||
|
||||
if (!Vars::Misc::Steam::EnableRPC.Value)
|
||||
if (!Vars::Misc::SteamRPC::Enabled.Value)
|
||||
return false;
|
||||
|
||||
I::SteamFriends->SetRichPresence("steam_display", "#TF_RichPresence_Display");
|
||||
if (!I::EngineClient->IsInGame() && !Vars::Misc::Steam::OverrideMenu.Value)
|
||||
if (!I::EngineClient->IsInGame() && !Vars::Misc::SteamRPC::OverrideInMenu.Value)
|
||||
I::SteamFriends->SetRichPresence("state", "MainMenu");
|
||||
else
|
||||
{
|
||||
I::SteamFriends->SetRichPresence("state", "PlayingMatchGroup");
|
||||
|
||||
switch (Vars::Misc::Steam::MatchGroup.Value)
|
||||
switch (Vars::Misc::SteamRPC::MatchGroup.Value)
|
||||
{
|
||||
case Vars::Misc::Steam::MatchGroupEnum::SpecialEvent: I::SteamFriends->SetRichPresence("matchgrouploc", "SpecialEvent"); break;
|
||||
case Vars::Misc::Steam::MatchGroupEnum::MvMMannUp: I::SteamFriends->SetRichPresence("matchgrouploc", "MannUp"); break;
|
||||
case Vars::Misc::Steam::MatchGroupEnum::Competitive: I::SteamFriends->SetRichPresence("matchgrouploc", "Competitive6v6"); break;
|
||||
case Vars::Misc::Steam::MatchGroupEnum::Casual: I::SteamFriends->SetRichPresence("matchgrouploc", "Casual"); break;
|
||||
case Vars::Misc::Steam::MatchGroupEnum::MvMBootCamp: I::SteamFriends->SetRichPresence("matchgrouploc", "BootCamp"); break;
|
||||
case Vars::Misc::SteamRPC::MatchGroupEnum::SpecialEvent: I::SteamFriends->SetRichPresence("matchgrouploc", "SpecialEvent"); break;
|
||||
case Vars::Misc::SteamRPC::MatchGroupEnum::MvMMannUp: I::SteamFriends->SetRichPresence("matchgrouploc", "MannUp"); break;
|
||||
case Vars::Misc::SteamRPC::MatchGroupEnum::Competitive: I::SteamFriends->SetRichPresence("matchgrouploc", "Competitive6v6"); break;
|
||||
case Vars::Misc::SteamRPC::MatchGroupEnum::Casual: I::SteamFriends->SetRichPresence("matchgrouploc", "Casual"); break;
|
||||
case Vars::Misc::SteamRPC::MatchGroupEnum::MvMBootCamp: I::SteamFriends->SetRichPresence("matchgrouploc", "BootCamp"); break;
|
||||
}
|
||||
}
|
||||
I::SteamFriends->SetRichPresence("currentmap", Vars::Misc::Steam::MapText.Value.c_str());
|
||||
I::SteamFriends->SetRichPresence("steam_player_group_size", std::to_string(Vars::Misc::Steam::GroupSize.Value).c_str());
|
||||
I::SteamFriends->SetRichPresence("currentmap", Vars::Misc::SteamRPC::MapText.Value.c_str());
|
||||
I::SteamFriends->SetRichPresence("steam_player_group_size", std::to_string(Vars::Misc::SteamRPC::GroupSize.Value).c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -6,7 +6,6 @@ class CMisc
|
||||
void AutoJump(CTFPlayer* pLocal, CUserCmd* pCmd);
|
||||
void AutoJumpbug(CTFPlayer* pLocal, CUserCmd* pCmd);
|
||||
void AutoStrafe(CTFPlayer* pLocal, CUserCmd* pCmd);
|
||||
void AutoPeek(CTFPlayer* pLocal, CUserCmd* pCmd);
|
||||
void MovementLock(CTFPlayer* pLocal, CUserCmd* pCmd);
|
||||
void BreakJump(CTFPlayer* pLocal, CUserCmd* pCmd);
|
||||
void AntiAFK(CTFPlayer* pLocal, CUserCmd* pCmd);
|
||||
@@ -19,6 +18,7 @@ class CMisc
|
||||
void TauntKartControl(CTFPlayer* pLocal, CUserCmd* pCmd);
|
||||
void FastMovement(CTFPlayer* pLocal, CUserCmd* pCmd);
|
||||
|
||||
void AutoPeek(CTFPlayer* pLocal, CUserCmd* pCmd, bool bPost = false);
|
||||
void EdgeJump(CTFPlayer* pLocal, CUserCmd* pCmd, bool bPost = false);
|
||||
|
||||
bool m_bPeekPlaced = false;
|
||||
|
||||
@@ -20,7 +20,7 @@ void COutput::OutputInfo(int flags, std::string sName, std::string sOutput, std:
|
||||
flags & Vars::Logging::LogToEnum::Party
|
||||
);
|
||||
if (flags & Vars::Logging::LogToEnum::Chat)
|
||||
SDK::Output(Vars::Menu::CheatPrefix.Value.c_str(), sChat.c_str(), Vars::Menu::Theme::Accent.Value, false, false, false, false, true, false, -1, "", "");
|
||||
SDK::Output(Vars::Menu::CheatTag.Value.c_str(), sChat.c_str(), Vars::Menu::Theme::Accent.Value, false, false, false, false, true, false, -1, "", "");
|
||||
}
|
||||
|
||||
// Event info
|
||||
@@ -212,7 +212,7 @@ void COutput::TagsOnJoin(std::string sName, uint32_t uFriendsID)
|
||||
for (auto& iID : F::PlayerUtils.m_mPlayerTags[uFriendsID])
|
||||
{
|
||||
if (auto pTag = F::PlayerUtils.GetTag(iID))
|
||||
vColorsTags.emplace_back(pTag->Color.ToHexA(), pTag->Name);
|
||||
vColorsTags.emplace_back(pTag->m_tColor.ToHexA(), pTag->m_sName);
|
||||
}
|
||||
|
||||
std::string sOutputText, sChatText;
|
||||
|
||||
@@ -7,26 +7,26 @@
|
||||
|
||||
bool CAntiAim::AntiAimOn()
|
||||
{
|
||||
return Vars::AntiHack::AntiAim::Enabled.Value
|
||||
&& (Vars::AntiHack::AntiAim::PitchReal.Value
|
||||
|| Vars::AntiHack::AntiAim::PitchFake.Value
|
||||
|| Vars::AntiHack::AntiAim::YawReal.Value
|
||||
|| Vars::AntiHack::AntiAim::YawFake.Value
|
||||
|| Vars::AntiHack::AntiAim::RealYawMode.Value
|
||||
|| Vars::AntiHack::AntiAim::FakeYawMode.Value
|
||||
|| Vars::AntiHack::AntiAim::RealYawOffset.Value
|
||||
|| Vars::AntiHack::AntiAim::FakeYawOffset.Value);
|
||||
return Vars::AntiAim::Enabled.Value
|
||||
&& (Vars::AntiAim::PitchReal.Value
|
||||
|| Vars::AntiAim::PitchFake.Value
|
||||
|| Vars::AntiAim::YawReal.Value
|
||||
|| Vars::AntiAim::YawFake.Value
|
||||
|| Vars::AntiAim::RealYawMode.Value
|
||||
|| Vars::AntiAim::FakeYawMode.Value
|
||||
|| Vars::AntiAim::RealYawOffset.Value
|
||||
|| Vars::AntiAim::FakeYawOffset.Value);
|
||||
}
|
||||
|
||||
bool CAntiAim::YawOn()
|
||||
{
|
||||
return Vars::AntiHack::AntiAim::Enabled.Value
|
||||
&& (Vars::AntiHack::AntiAim::YawReal.Value
|
||||
|| Vars::AntiHack::AntiAim::YawFake.Value
|
||||
|| Vars::AntiHack::AntiAim::RealYawMode.Value
|
||||
|| Vars::AntiHack::AntiAim::FakeYawMode.Value
|
||||
|| Vars::AntiHack::AntiAim::RealYawOffset.Value
|
||||
|| Vars::AntiHack::AntiAim::FakeYawOffset.Value);
|
||||
return Vars::AntiAim::Enabled.Value
|
||||
&& (Vars::AntiAim::YawReal.Value
|
||||
|| Vars::AntiAim::YawFake.Value
|
||||
|| Vars::AntiAim::RealYawMode.Value
|
||||
|| Vars::AntiAim::FakeYawMode.Value
|
||||
|| Vars::AntiAim::RealYawOffset.Value
|
||||
|| Vars::AntiAim::FakeYawOffset.Value);
|
||||
}
|
||||
|
||||
bool CAntiAim::ShouldRun(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd)
|
||||
@@ -46,8 +46,7 @@ bool CAntiAim::ShouldRun(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pC
|
||||
|
||||
void CAntiAim::FakeShotAngles(CTFPlayer* pLocal, CUserCmd* pCmd)
|
||||
{
|
||||
if (!pLocal || pLocal->m_MoveType() == MOVETYPE_WALK
|
||||
|| !Vars::AntiHack::AntiAim::InvalidShootPitch.Value || G::Attacking != 1 || G::PrimaryWeaponType != EWeaponType::HITSCAN)
|
||||
if (!Vars::AntiAim::InvalidShootPitch.Value || G::Attacking != 1 || G::PrimaryWeaponType != EWeaponType::HITSCAN || !pLocal || pLocal->m_MoveType() == MOVETYPE_WALK)
|
||||
return;
|
||||
|
||||
G::SilentAngles = true;
|
||||
@@ -68,25 +67,21 @@ float CAntiAim::EdgeDistance(CTFPlayer* pEntity, float flEdgeRayYaw, float flOff
|
||||
|
||||
vEdgeTrace.emplace_back(vCenter, trace.endpos);
|
||||
|
||||
return (trace.startpos - trace.endpos).Length2D();
|
||||
return trace.fraction;
|
||||
}
|
||||
|
||||
int CAntiAim::GetEdge(CTFPlayer* pEntity, const float flEdgeOrigYaw, bool bUpPitch)
|
||||
int CAntiAim::GetEdge(CTFPlayer* pEntity, const float flEdgeOrigYaw)
|
||||
{
|
||||
// we should probably make this dynamic for different head positions
|
||||
|
||||
float flSize = pEntity->m_vecMaxs().y - pEntity->m_vecMins().y;
|
||||
float flEdgeLeftDist = EdgeDistance(pEntity, flEdgeOrigYaw, -flSize);
|
||||
float flEdgeRightDist = EdgeDistance(pEntity, flEdgeOrigYaw, flSize);
|
||||
|
||||
if (flEdgeLeftDist > 299.f && flEdgeRightDist > 299.f)
|
||||
return bUpPitch ? 1 : -1;
|
||||
return (bUpPitch ? flEdgeLeftDist > flEdgeRightDist : flEdgeLeftDist < flEdgeRightDist) ? 1 : -1;
|
||||
return flEdgeLeftDist > flEdgeRightDist ? -1 : 1;
|
||||
}
|
||||
|
||||
void CAntiAim::RunOverlapping(CTFPlayer* pEntity, CUserCmd* pCmd, float& flRealYaw, bool bFake, float flEpsilon)
|
||||
{
|
||||
if (!Vars::AntiHack::AntiAim::AntiOverlap.Value || bFake)
|
||||
if (!Vars::AntiAim::AntiOverlap.Value || bFake)
|
||||
return;
|
||||
|
||||
float flFakeYaw = GetBaseYaw(pEntity, pCmd, true) + GetYawOffset(pEntity, true);
|
||||
@@ -106,31 +101,30 @@ inline int GetJitter(uint32_t uHash)
|
||||
|
||||
float CAntiAim::GetYawOffset(CTFPlayer* pEntity, bool bFake)
|
||||
{
|
||||
const int iMode = bFake ? Vars::AntiHack::AntiAim::YawFake.Value : Vars::AntiHack::AntiAim::YawReal.Value;
|
||||
const bool bUpPitch = (bFake ? Vars::AntiHack::AntiAim::PitchFake.Value : Vars::AntiHack::AntiAim::PitchReal.Value) == Vars::AntiHack::AntiAim::PitchRealEnum::Up;
|
||||
const int iMode = bFake ? Vars::AntiAim::YawFake.Value : Vars::AntiAim::YawReal.Value;
|
||||
int iJitter = GetJitter(FNV1A::Hash32Const("Yaw"));
|
||||
|
||||
switch (iMode)
|
||||
{
|
||||
case Vars::AntiHack::AntiAim::YawEnum::Forward: return 0.f;
|
||||
case Vars::AntiHack::AntiAim::YawEnum::Left: return 90.f;
|
||||
case Vars::AntiHack::AntiAim::YawEnum::Right: return -90.f;
|
||||
case Vars::AntiHack::AntiAim::YawEnum::Backwards: return 180.f;
|
||||
case Vars::AntiHack::AntiAim::YawEnum::Edge: return (bFake ? Vars::AntiHack::AntiAim::FakeYawValue.Value : Vars::AntiHack::AntiAim::RealYawValue.Value) * GetEdge(pEntity, I::EngineClient->GetViewAngles().y, bUpPitch);
|
||||
case Vars::AntiHack::AntiAim::YawEnum::Jitter: return (bFake ? Vars::AntiHack::AntiAim::FakeYawValue.Value : Vars::AntiHack::AntiAim::RealYawValue.Value) * iJitter;
|
||||
case Vars::AntiHack::AntiAim::YawEnum::Spin: return fmod(I::GlobalVars->tickcount * Vars::AntiHack::AntiAim::SpinSpeed.Value + 180.f, 360.f) - 180.f;
|
||||
case Vars::AntiAim::YawEnum::Forward: return 0.f;
|
||||
case Vars::AntiAim::YawEnum::Left: return 90.f;
|
||||
case Vars::AntiAim::YawEnum::Right: return -90.f;
|
||||
case Vars::AntiAim::YawEnum::Backwards: return 180.f;
|
||||
case Vars::AntiAim::YawEnum::Edge: return (bFake ? Vars::AntiAim::FakeYawValue.Value : Vars::AntiAim::RealYawValue.Value) * GetEdge(pEntity, I::EngineClient->GetViewAngles().y);
|
||||
case Vars::AntiAim::YawEnum::Jitter: return (bFake ? Vars::AntiAim::FakeYawValue.Value : Vars::AntiAim::RealYawValue.Value) * iJitter;
|
||||
case Vars::AntiAim::YawEnum::Spin: return fmod(I::GlobalVars->tickcount * Vars::AntiAim::SpinSpeed.Value + 180.f, 360.f) - 180.f;
|
||||
}
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
float CAntiAim::GetBaseYaw(CTFPlayer* pLocal, CUserCmd* pCmd, bool bFake)
|
||||
{
|
||||
const int iMode = bFake ? Vars::AntiHack::AntiAim::FakeYawMode.Value : Vars::AntiHack::AntiAim::RealYawMode.Value;
|
||||
const float flOffset = bFake ? Vars::AntiHack::AntiAim::FakeYawOffset.Value : Vars::AntiHack::AntiAim::RealYawOffset.Value;
|
||||
const int iMode = bFake ? Vars::AntiAim::FakeYawMode.Value : Vars::AntiAim::RealYawMode.Value;
|
||||
const float flOffset = bFake ? Vars::AntiAim::FakeYawOffset.Value : Vars::AntiAim::RealYawOffset.Value;
|
||||
switch (iMode) // 0 offset, 1 at player
|
||||
{
|
||||
case Vars::AntiHack::AntiAim::YawModeEnum::View: return pCmd->viewangles.y + flOffset;
|
||||
case Vars::AntiHack::AntiAim::YawModeEnum::Target:
|
||||
case Vars::AntiAim::YawModeEnum::View: return pCmd->viewangles.y + flOffset;
|
||||
case Vars::AntiAim::YawModeEnum::Target:
|
||||
{
|
||||
float flSmallestAngleTo = 0.f; float flSmallestFovTo = 360.f;
|
||||
for (auto pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_ENEMIES))
|
||||
@@ -166,28 +160,28 @@ float CAntiAim::GetPitch(float flCurPitch)
|
||||
float flRealPitch = 0.f, flFakePitch = 0.f;
|
||||
int iJitter = GetJitter(FNV1A::Hash32Const("Pitch"));
|
||||
|
||||
switch (Vars::AntiHack::AntiAim::PitchReal.Value)
|
||||
switch (Vars::AntiAim::PitchReal.Value)
|
||||
{
|
||||
case Vars::AntiHack::AntiAim::PitchRealEnum::Up: flRealPitch = -89.f; break;
|
||||
case Vars::AntiHack::AntiAim::PitchRealEnum::Down: flRealPitch = 89.f; break;
|
||||
case Vars::AntiHack::AntiAim::PitchRealEnum::Zero: flRealPitch = 0.f; break;
|
||||
case Vars::AntiHack::AntiAim::PitchRealEnum::Jitter: flRealPitch = -89.f * iJitter; break;
|
||||
case Vars::AntiHack::AntiAim::PitchRealEnum::ReverseJitter: flRealPitch = 89.f * iJitter; break;
|
||||
case Vars::AntiAim::PitchRealEnum::Up: flRealPitch = -89.f; break;
|
||||
case Vars::AntiAim::PitchRealEnum::Down: flRealPitch = 89.f; break;
|
||||
case Vars::AntiAim::PitchRealEnum::Zero: flRealPitch = 0.f; break;
|
||||
case Vars::AntiAim::PitchRealEnum::Jitter: flRealPitch = -89.f * iJitter; break;
|
||||
case Vars::AntiAim::PitchRealEnum::ReverseJitter: flRealPitch = 89.f * iJitter; break;
|
||||
}
|
||||
|
||||
switch (Vars::AntiHack::AntiAim::PitchFake.Value)
|
||||
switch (Vars::AntiAim::PitchFake.Value)
|
||||
{
|
||||
case Vars::AntiHack::AntiAim::PitchFakeEnum::Up: flFakePitch = -89.f; break;
|
||||
case Vars::AntiHack::AntiAim::PitchFakeEnum::Down: flFakePitch = 89.f; break;
|
||||
case Vars::AntiHack::AntiAim::PitchFakeEnum::Jitter: flFakePitch = -89.f * iJitter; break;
|
||||
case Vars::AntiHack::AntiAim::PitchFakeEnum::ReverseJitter: flFakePitch = 89.f * iJitter; break;
|
||||
case Vars::AntiAim::PitchFakeEnum::Up: flFakePitch = -89.f; break;
|
||||
case Vars::AntiAim::PitchFakeEnum::Down: flFakePitch = 89.f; break;
|
||||
case Vars::AntiAim::PitchFakeEnum::Jitter: flFakePitch = -89.f * iJitter; break;
|
||||
case Vars::AntiAim::PitchFakeEnum::ReverseJitter: flFakePitch = 89.f * iJitter; break;
|
||||
}
|
||||
|
||||
if (Vars::AntiHack::AntiAim::PitchReal.Value && Vars::AntiHack::AntiAim::PitchFake.Value)
|
||||
if (Vars::AntiAim::PitchReal.Value && Vars::AntiAim::PitchFake.Value)
|
||||
return flRealPitch + (flFakePitch > 0.f ? 360 : -360);
|
||||
else if (Vars::AntiHack::AntiAim::PitchReal.Value)
|
||||
else if (Vars::AntiAim::PitchReal.Value)
|
||||
return flRealPitch;
|
||||
else if (Vars::AntiHack::AntiAim::PitchFake.Value)
|
||||
else if (Vars::AntiAim::PitchFake.Value)
|
||||
return flFakePitch;
|
||||
else
|
||||
return flCurPitch;
|
||||
@@ -195,7 +189,7 @@ float CAntiAim::GetPitch(float flCurPitch)
|
||||
|
||||
void CAntiAim::MinWalk(CTFPlayer* pLocal, CUserCmd* pCmd)
|
||||
{
|
||||
if (!Vars::AntiHack::AntiAim::MinWalk.Value || !F::AntiAim.YawOn() || !pLocal->m_hGroundEntity() || pLocal->InCond(TF_COND_HALLOWEEN_KART))
|
||||
if (!Vars::AntiAim::MinWalk.Value || !F::AntiAim.YawOn() || !pLocal->m_hGroundEntity() || pLocal->InCond(TF_COND_HALLOWEEN_KART))
|
||||
return;
|
||||
|
||||
if (!pCmd->forwardmove && !pCmd->sidemove && pLocal->m_vecVelocity().Length2D() < 2.f)
|
||||
@@ -216,8 +210,6 @@ void CAntiAim::MinWalk(CTFPlayer* pLocal, CUserCmd* pCmd)
|
||||
|
||||
void CAntiAim::Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd, bool bSendPacket)
|
||||
{
|
||||
vEdgeTrace.clear();
|
||||
|
||||
G::AntiAim = AntiAimOn() && ShouldRun(pLocal, pWeapon, pCmd);
|
||||
|
||||
int iAntiBackstab = F::Misc.AntiBackstab(pLocal, pCmd, bSendPacket);
|
||||
@@ -231,6 +223,8 @@ void CAntiAim::Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd, bo
|
||||
return;
|
||||
}
|
||||
|
||||
vEdgeTrace.clear();
|
||||
|
||||
Vec2& vAngles = bSendPacket ? vFakeAngles : vRealAngles;
|
||||
vAngles.x = iAntiBackstab != 2 ? GetPitch(pCmd->viewangles.x) : pCmd->viewangles.x;
|
||||
vAngles.y = !iAntiBackstab ? GetYaw(pLocal, pCmd, bSendPacket) : pCmd->viewangles.y;
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
bool YawOn();
|
||||
bool ShouldRun(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd);
|
||||
|
||||
int GetEdge(CTFPlayer* pEntity, float flEdgeOrigYaw, bool bUpPitch);
|
||||
int GetEdge(CTFPlayer* pEntity, float flEdgeOrigYaw);
|
||||
void Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd, bool bSendPacket);
|
||||
|
||||
inline int AntiAimTicks() { return 3; }
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
bool CFakeLag::IsAllowed(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd)
|
||||
{
|
||||
if (!(Vars::CL_Move::Fakelag::Fakelag.Value || m_bPreservingBlast || m_bUnducking)
|
||||
if (!(Vars::Fakelag::Fakelag.Value || m_bPreservingBlast || m_bUnducking)
|
||||
|| I::ClientState->chokedcommands >= std::min(24 - F::Ticks.m_iShiftedTicks, std::min(21, F::Ticks.m_iMaxShift))
|
||||
|| F::Ticks.m_iShiftedGoal != F::Ticks.m_iShiftedTicks || F::Ticks.m_bRecharge
|
||||
|| !pLocal->IsAlive() || pLocal->IsAGhost())
|
||||
@@ -17,24 +17,24 @@ bool CFakeLag::IsAllowed(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pC
|
||||
return true;
|
||||
}
|
||||
|
||||
if (G::Attacking == 1 && Vars::CL_Move::Fakelag::UnchokeOnAttack.Value || F::AutoRocketJump.IsRunning()
|
||||
|| Vars::CL_Move::Fakelag::Options.Value & Vars::CL_Move::Fakelag::OptionsEnum::WhileAirborne && !pLocal->m_hGroundEntity()
|
||||
if (G::Attacking == 1 && Vars::Fakelag::UnchokeOnAttack.Value || F::AutoRocketJump.IsRunning()
|
||||
|| Vars::Fakelag::Options.Value & Vars::Fakelag::OptionsEnum::NotAirborne && !pLocal->m_hGroundEntity()
|
||||
|| pWeapon && pWeapon->m_iItemDefinitionIndex() == Soldier_m_TheBeggarsBazooka && pCmd->buttons & IN_ATTACK && !(G::LastUserCmd->buttons & IN_ATTACK)) // try to prevent issues
|
||||
return false;
|
||||
|
||||
if (m_bUnducking)
|
||||
return true;
|
||||
|
||||
const bool bMoving = !(Vars::CL_Move::Fakelag::Options.Value & Vars::CL_Move::Fakelag::OptionsEnum::WhileMoving) || pLocal->m_vecVelocity().Length2D() > 10.f;
|
||||
const bool bMoving = !(Vars::Fakelag::Options.Value & Vars::Fakelag::OptionsEnum::OnlyMoving) || pLocal->m_vecVelocity().Length2D() > 10.f;
|
||||
if (!bMoving)
|
||||
return false;
|
||||
|
||||
switch (Vars::CL_Move::Fakelag::Fakelag.Value)
|
||||
switch (Vars::Fakelag::Fakelag.Value)
|
||||
{
|
||||
case Vars::CL_Move::Fakelag::FakelagEnum::Plain:
|
||||
case Vars::CL_Move::Fakelag::FakelagEnum::Random:
|
||||
case Vars::Fakelag::FakelagEnum::Plain:
|
||||
case Vars::Fakelag::FakelagEnum::Random:
|
||||
return I::ClientState->chokedcommands < m_iGoal;
|
||||
case Vars::CL_Move::Fakelag::FakelagEnum::Adaptive:
|
||||
case Vars::Fakelag::FakelagEnum::Adaptive:
|
||||
{
|
||||
const Vec3 vDelta = m_vLastPosition - pLocal->m_vecOrigin();
|
||||
return vDelta.Length2DSqr() < 4096.f;
|
||||
@@ -48,8 +48,8 @@ void CFakeLag::PreserveBlastJump(CTFPlayer* pLocal)
|
||||
{
|
||||
m_bPreservingBlast = false;
|
||||
|
||||
if (!Vars::CL_Move::Fakelag::RetainBlastJump.Value || Vars::Misc::Movement::AutoRocketJump.Value || Vars::Misc::Movement::AutoCTap.Value
|
||||
|| !pLocal->IsAlive() || pLocal->IsAGhost() || Vars::CL_Move::Fakelag::RetainSoldierOnly.Value && pLocal->m_iClass() != TF_CLASS_SOLDIER)
|
||||
if (!Vars::Fakelag::RetainBlastJump.Value || Vars::Misc::Movement::AutoRocketJump.Value || Vars::Misc::Movement::AutoCTap.Value
|
||||
|| !pLocal->IsAlive() || pLocal->IsAGhost() || Vars::Fakelag::RetainSoldierOnly.Value && pLocal->m_iClass() != TF_CLASS_SOLDIER)
|
||||
return;
|
||||
static bool bStaticGround = true;
|
||||
const bool bLastGround = bStaticGround;
|
||||
@@ -64,7 +64,7 @@ void CFakeLag::Unduck(CTFPlayer* pLocal, CUserCmd* pCmd)
|
||||
{
|
||||
m_bUnducking = false;
|
||||
|
||||
if (!(Vars::CL_Move::Fakelag::Options.Value & Vars::CL_Move::Fakelag::OptionsEnum::WhileUnducking)
|
||||
if (!(Vars::Fakelag::Options.Value & Vars::Fakelag::OptionsEnum::OnUnduck)
|
||||
|| !pLocal->IsAlive() || pLocal->IsAGhost())
|
||||
return;
|
||||
if (!(pLocal->m_hGroundEntity() && pLocal->IsDucking() && !(pCmd->buttons & IN_DUCK)))
|
||||
@@ -86,12 +86,12 @@ void CFakeLag::Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd, bo
|
||||
|
||||
if (!m_iGoal)
|
||||
{
|
||||
switch (Vars::CL_Move::Fakelag::Fakelag.Value)
|
||||
switch (Vars::Fakelag::Fakelag.Value)
|
||||
{
|
||||
case Vars::CL_Move::Fakelag::FakelagEnum::Off: m_iGoal = 0; break;
|
||||
case Vars::CL_Move::Fakelag::FakelagEnum::Plain: m_iGoal = Vars::CL_Move::Fakelag::PlainTicks.Value; break;
|
||||
case Vars::CL_Move::Fakelag::FakelagEnum::Random: m_iGoal = SDK::StdRandomInt(Vars::CL_Move::Fakelag::RandomTicks.Value.Min, Vars::CL_Move::Fakelag::RandomTicks.Value.Max); break;
|
||||
case Vars::CL_Move::Fakelag::FakelagEnum::Adaptive: m_iGoal = 22; break;
|
||||
case Vars::Fakelag::FakelagEnum::Off: m_iGoal = 0; break;
|
||||
case Vars::Fakelag::FakelagEnum::Plain: m_iGoal = Vars::Fakelag::PlainTicks.Value; break;
|
||||
case Vars::Fakelag::FakelagEnum::Random: m_iGoal = SDK::StdRandomInt(Vars::Fakelag::RandomTicks.Value.Min, Vars::Fakelag::RandomTicks.Value.Max); break;
|
||||
case Vars::Fakelag::FakelagEnum::Adaptive: m_iGoal = 22; break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ static inline bool AntiAimCheck(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUser
|
||||
|
||||
void CPacketManip::Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd, bool* pSendPacket)
|
||||
{
|
||||
F::FakeAngle.bDrawChams = Vars::CL_Move::Fakelag::Fakelag.Value || F::AntiAim.AntiAimOn();
|
||||
F::FakeAngle.bDrawChams = Vars::Fakelag::Fakelag.Value || F::AntiAim.AntiAimOn();
|
||||
|
||||
*pSendPacket = true;
|
||||
F::FakeLag.Run(pLocal, pWeapon, pCmd, pSendPacket);
|
||||
|
||||
@@ -29,10 +29,10 @@ void CPlayerlistCore::SavePlayerlist()
|
||||
auto& tTag = *it;
|
||||
|
||||
boost::property_tree::ptree tagEntry;
|
||||
tagEntry.put("Name", tTag.Name);
|
||||
tagEntry.put_child("Color", F::Configs.ColorToTree(tTag.Color));
|
||||
tagEntry.put("Priority", tTag.Priority);
|
||||
tagEntry.put("Label", tTag.Label);
|
||||
tagEntry.put("Name", tTag.m_sName);
|
||||
tagEntry.put_child("Color", F::Configs.ColorToTree(tTag.m_tColor));
|
||||
tagEntry.put("Priority", tTag.m_iPriority);
|
||||
tagEntry.put("Label", tTag.m_bLabel);
|
||||
|
||||
configTree.put_child(std::to_string(F::PlayerUtils.IndexToTag(iID)), tagEntry);
|
||||
}
|
||||
@@ -73,7 +73,7 @@ void CPlayerlistCore::SavePlayerlist()
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
SDK::Output("SavePlayerlist", "Failed", { 175, 150, 255 }, true, true);
|
||||
SDK::Output("Amalgam", "Save playerlist failed", { 175, 150, 255, 127 }, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,10 +108,10 @@ void CPlayerlistCore::LoadPlayerlist()
|
||||
for (auto& it : *configTree)
|
||||
{
|
||||
PriorityLabel_t tTag = {};
|
||||
if (auto getValue = it.second.get_optional<std::string>("Name")) { tTag.Name = *getValue; }
|
||||
if (const auto getChild = it.second.get_child_optional("Color")) { F::Configs.TreeToColor(*getChild, tTag.Color); }
|
||||
if (auto getValue = it.second.get_optional<int>("Priority")) { tTag.Priority = *getValue; }
|
||||
if (auto getValue = it.second.get_optional<bool>("Label")) { tTag.Label = *getValue; }
|
||||
if (auto getValue = it.second.get_optional<std::string>("Name")) { tTag.m_sName = *getValue; }
|
||||
if (const auto getChild = it.second.get_child_optional("Color")) { F::Configs.TreeToColor(*getChild, tTag.m_tColor); }
|
||||
if (auto getValue = it.second.get_optional<int>("Priority")) { tTag.m_iPriority = *getValue; }
|
||||
if (auto getValue = it.second.get_optional<bool>("Label")) { tTag.m_bLabel = *getValue; }
|
||||
|
||||
int iID = -1;
|
||||
try
|
||||
@@ -123,10 +123,10 @@ void CPlayerlistCore::LoadPlayerlist()
|
||||
|
||||
if (iID > -1 && iID < F::PlayerUtils.m_vTags.size())
|
||||
{
|
||||
F::PlayerUtils.m_vTags[iID].Name = tTag.Name;
|
||||
F::PlayerUtils.m_vTags[iID].Color = tTag.Color;
|
||||
F::PlayerUtils.m_vTags[iID].Priority = tTag.Priority;
|
||||
F::PlayerUtils.m_vTags[iID].Label = tTag.Label;
|
||||
F::PlayerUtils.m_vTags[iID].m_sName = tTag.m_sName;
|
||||
F::PlayerUtils.m_vTags[iID].m_tColor = tTag.m_tColor;
|
||||
F::PlayerUtils.m_vTags[iID].m_iPriority = tTag.m_iPriority;
|
||||
F::PlayerUtils.m_vTags[iID].m_bLabel = tTag.m_bLabel;
|
||||
}
|
||||
else
|
||||
F::PlayerUtils.m_vTags.push_back(tTag);
|
||||
@@ -146,10 +146,10 @@ void CPlayerlistCore::LoadPlayerlist()
|
||||
for (auto& it : *tagTree)
|
||||
{
|
||||
PriorityLabel_t tTag = {};
|
||||
if (auto getValue = it.second.get_optional<std::string>("Name")) { tTag.Name = *getValue; }
|
||||
if (const auto getChild = it.second.get_child_optional("Color")) { F::Configs.TreeToColor(*getChild, tTag.Color); }
|
||||
if (auto getValue = it.second.get_optional<int>("Priority")) { tTag.Priority = *getValue; }
|
||||
if (auto getValue = it.second.get_optional<bool>("Label")) { tTag.Label = *getValue; }
|
||||
if (auto getValue = it.second.get_optional<std::string>("Name")) { tTag.m_sName = *getValue; }
|
||||
if (const auto getChild = it.second.get_child_optional("Color")) { F::Configs.TreeToColor(*getChild, tTag.m_tColor); }
|
||||
if (auto getValue = it.second.get_optional<int>("Priority")) { tTag.m_iPriority = *getValue; }
|
||||
if (auto getValue = it.second.get_optional<bool>("Label")) { tTag.m_bLabel = *getValue; }
|
||||
|
||||
int iID = -1;
|
||||
try
|
||||
@@ -162,16 +162,16 @@ void CPlayerlistCore::LoadPlayerlist()
|
||||
}
|
||||
catch (...)
|
||||
{ // old string based indexing
|
||||
tTag.Name = it.first;
|
||||
tTag.m_sName = it.first;
|
||||
iID = F::PlayerUtils.GetTag(it.first);
|
||||
}
|
||||
|
||||
if (iID > -1 && iID < F::PlayerUtils.m_vTags.size())
|
||||
{
|
||||
F::PlayerUtils.m_vTags[iID].Name = tTag.Name;
|
||||
F::PlayerUtils.m_vTags[iID].Color = tTag.Color;
|
||||
F::PlayerUtils.m_vTags[iID].Priority = tTag.Priority;
|
||||
F::PlayerUtils.m_vTags[iID].Label = tTag.Label;
|
||||
F::PlayerUtils.m_vTags[iID].m_sName = tTag.m_sName;
|
||||
F::PlayerUtils.m_vTags[iID].m_tColor = tTag.m_tColor;
|
||||
F::PlayerUtils.m_vTags[iID].m_iPriority = tTag.m_iPriority;
|
||||
F::PlayerUtils.m_vTags[iID].m_bLabel = tTag.m_bLabel;
|
||||
}
|
||||
else
|
||||
F::PlayerUtils.m_vTags.push_back(tTag);
|
||||
@@ -208,7 +208,7 @@ void CPlayerlistCore::LoadPlayerlist()
|
||||
continue;
|
||||
|
||||
auto pTag = F::PlayerUtils.GetTag(iID);
|
||||
if (!pTag || !pTag->Assignable)
|
||||
if (!pTag || !pTag->m_bAssignable)
|
||||
continue;
|
||||
|
||||
if (!F::PlayerUtils.HasTag(uFriendsID, iID))
|
||||
@@ -234,6 +234,6 @@ void CPlayerlistCore::LoadPlayerlist()
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
SDK::Output("LoadPlayerlist", "Failed", { 175, 150, 255 }, true, true);
|
||||
SDK::Output("Amalgam", "Load playerlist failed", { 175, 150, 255, 127 }, true, true);
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ int CPlayerlistUtils::GetTag(std::string sTag)
|
||||
for (auto& tTag : m_vTags)
|
||||
{
|
||||
iID++;
|
||||
if (uHash == FNV1A::Hash32(tTag.Name.c_str()))
|
||||
if (uHash == FNV1A::Hash32(tTag.m_sName.c_str()))
|
||||
return iID;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ void CPlayerlistUtils::AddTag(uint32_t uFriendsID, int iID, bool bSave, std::str
|
||||
if (sName.length())
|
||||
{
|
||||
if (PriorityLabel_t* pTag = GetTag(iID))
|
||||
F::Output.TagsChanged(sName, "Added", pTag->Color.ToHexA(), pTag->Name);
|
||||
F::Output.TagsChanged(sName, "Added", pTag->m_tColor.ToHexA(), pTag->m_sName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,7 @@ void CPlayerlistUtils::RemoveTag(uint32_t uFriendsID, int iID, bool bSave, std::
|
||||
if (sName.length())
|
||||
{
|
||||
if (auto pTag = GetTag(iID))
|
||||
F::Output.TagsChanged(sName, "Removed", pTag->Color.ToHexA(), pTag->Name);
|
||||
F::Output.TagsChanged(sName, "Removed", pTag->m_tColor.ToHexA(), pTag->m_sName);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -153,37 +153,37 @@ int CPlayerlistUtils::GetPriority(uint32_t uFriendsID, bool bCache)
|
||||
if (bCache)
|
||||
return H::Entities.GetPriority(uFriendsID);
|
||||
|
||||
const int iDefault = m_vTags[TagToIndex(DEFAULT_TAG)].Priority;
|
||||
const int iDefault = m_vTags[TagToIndex(DEFAULT_TAG)].m_iPriority;
|
||||
if (!uFriendsID)
|
||||
return iDefault;
|
||||
|
||||
if (HasTag(uFriendsID, TagToIndex(IGNORED_TAG)))
|
||||
return m_vTags[TagToIndex(IGNORED_TAG)].Priority;
|
||||
return m_vTags[TagToIndex(IGNORED_TAG)].m_iPriority;
|
||||
|
||||
std::vector<int> vPriorities;
|
||||
for (auto& iID : m_mPlayerTags[uFriendsID])
|
||||
{
|
||||
auto pTag = GetTag(iID);
|
||||
if (pTag && !pTag->Label)
|
||||
vPriorities.push_back(pTag->Priority);
|
||||
if (pTag && !pTag->m_bLabel)
|
||||
vPriorities.push_back(pTag->m_iPriority);
|
||||
}
|
||||
if (H::Entities.IsFriend(uFriendsID))
|
||||
{
|
||||
auto& tTag = m_vTags[TagToIndex(FRIEND_TAG)];
|
||||
if (!tTag.Label)
|
||||
vPriorities.push_back(tTag.Priority);
|
||||
if (!tTag.m_bLabel)
|
||||
vPriorities.push_back(tTag.m_iPriority);
|
||||
}
|
||||
if (H::Entities.InParty(uFriendsID))
|
||||
{
|
||||
auto& tTag = m_vTags[TagToIndex(PARTY_TAG)];
|
||||
if (!tTag.Label)
|
||||
vPriorities.push_back(tTag.Priority);
|
||||
if (!tTag.m_bLabel)
|
||||
vPriorities.push_back(tTag.m_iPriority);
|
||||
}
|
||||
if (H::Entities.IsF2P(uFriendsID))
|
||||
{
|
||||
auto& tTag = m_vTags[TagToIndex(F2P_TAG)];
|
||||
if (!tTag.Label)
|
||||
vPriorities.push_back(tTag.Priority);
|
||||
if (!tTag.m_bLabel)
|
||||
vPriorities.push_back(tTag.m_iPriority);
|
||||
}
|
||||
|
||||
if (vPriorities.size())
|
||||
@@ -200,7 +200,7 @@ int CPlayerlistUtils::GetPriority(int iIndex, bool bCache)
|
||||
|
||||
if (const uint32_t uFriendsID = GetFriendsID(iIndex))
|
||||
return GetPriority(uFriendsID);
|
||||
return m_vTags[TagToIndex(DEFAULT_TAG)].Priority;
|
||||
return m_vTags[TagToIndex(DEFAULT_TAG)].m_iPriority;
|
||||
}
|
||||
|
||||
PriorityLabel_t* CPlayerlistUtils::GetSignificantTag(uint32_t uFriendsID, int iMode)
|
||||
@@ -217,25 +217,25 @@ PriorityLabel_t* CPlayerlistUtils::GetSignificantTag(uint32_t uFriendsID, int iM
|
||||
for (auto& iID : m_mPlayerTags[uFriendsID])
|
||||
{
|
||||
PriorityLabel_t* _pTag = GetTag(iID);
|
||||
if (_pTag && !_pTag->Label)
|
||||
if (_pTag && !_pTag->m_bLabel)
|
||||
vTags.push_back(_pTag);
|
||||
}
|
||||
if (H::Entities.IsFriend(uFriendsID))
|
||||
{
|
||||
auto _pTag = &m_vTags[TagToIndex(FRIEND_TAG)];
|
||||
if (!_pTag->Label)
|
||||
if (!_pTag->m_bLabel)
|
||||
vTags.push_back(_pTag);
|
||||
}
|
||||
if (H::Entities.InParty(uFriendsID))
|
||||
{
|
||||
auto _pTag = &m_vTags[TagToIndex(PARTY_TAG)];
|
||||
if (!_pTag->Label)
|
||||
if (!_pTag->m_bLabel)
|
||||
vTags.push_back(_pTag);
|
||||
}
|
||||
if (H::Entities.IsF2P(uFriendsID))
|
||||
{
|
||||
auto _pTag = &m_vTags[TagToIndex(F2P_TAG)];
|
||||
if (!_pTag->Label)
|
||||
if (!_pTag->m_bLabel)
|
||||
vTags.push_back(_pTag);
|
||||
}
|
||||
}
|
||||
@@ -244,25 +244,25 @@ PriorityLabel_t* CPlayerlistUtils::GetSignificantTag(uint32_t uFriendsID, int iM
|
||||
for (auto& iID : m_mPlayerTags[uFriendsID])
|
||||
{
|
||||
PriorityLabel_t* _pTag = GetTag(iID);
|
||||
if (_pTag && _pTag->Label)
|
||||
if (_pTag && _pTag->m_bLabel)
|
||||
vTags.push_back(_pTag);
|
||||
}
|
||||
if (H::Entities.IsFriend(uFriendsID))
|
||||
{
|
||||
auto _pTag = &m_vTags[TagToIndex(FRIEND_TAG)];
|
||||
if (_pTag->Label)
|
||||
if (_pTag->m_bLabel)
|
||||
vTags.push_back(_pTag);
|
||||
}
|
||||
if (H::Entities.InParty(uFriendsID))
|
||||
{
|
||||
auto _pTag = &m_vTags[TagToIndex(PARTY_TAG)];
|
||||
if (_pTag->Label)
|
||||
if (_pTag->m_bLabel)
|
||||
vTags.push_back(_pTag);
|
||||
}
|
||||
if (H::Entities.IsF2P(uFriendsID))
|
||||
{
|
||||
auto _pTag = &m_vTags[TagToIndex(F2P_TAG)];
|
||||
if (_pTag->Label)
|
||||
if (_pTag->m_bLabel)
|
||||
vTags.push_back(_pTag);
|
||||
}
|
||||
}
|
||||
@@ -272,10 +272,10 @@ PriorityLabel_t* CPlayerlistUtils::GetSignificantTag(uint32_t uFriendsID, int iM
|
||||
std::sort(vTags.begin(), vTags.end(), [&](const auto a, const auto b) -> bool
|
||||
{
|
||||
// sort by priority if unequal
|
||||
if (a->Priority != b->Priority)
|
||||
return a->Priority > b->Priority;
|
||||
if (a->m_iPriority != b->m_iPriority)
|
||||
return a->m_iPriority > b->m_iPriority;
|
||||
|
||||
return a->Name < b->Name;
|
||||
return a->m_sName < b->m_sName;
|
||||
});
|
||||
return vTags.front();
|
||||
}
|
||||
@@ -292,7 +292,7 @@ bool CPlayerlistUtils::IsIgnored(uint32_t uFriendsID)
|
||||
return false;
|
||||
|
||||
const int iPriority = GetPriority(uFriendsID);
|
||||
const int iIgnored = m_vTags[TagToIndex(IGNORED_TAG)].Priority;
|
||||
const int iIgnored = m_vTags[TagToIndex(IGNORED_TAG)].m_iPriority;
|
||||
return iPriority <= iIgnored;
|
||||
}
|
||||
bool CPlayerlistUtils::IsIgnored(int iIndex)
|
||||
@@ -308,7 +308,7 @@ bool CPlayerlistUtils::IsPrioritized(uint32_t uFriendsID)
|
||||
return false;
|
||||
|
||||
const int iPriority = GetPriority(uFriendsID);
|
||||
const int iDefault = m_vTags[TagToIndex(DEFAULT_TAG)].Priority;
|
||||
const int iDefault = m_vTags[TagToIndex(DEFAULT_TAG)].m_iPriority;
|
||||
return iPriority > iDefault;
|
||||
}
|
||||
bool CPlayerlistUtils::IsPrioritized(int iIndex)
|
||||
@@ -351,7 +351,7 @@ const char* CPlayerlistUtils::GetPlayerName(int iIndex, const char* sDefault, in
|
||||
if (auto pTag = GetSignificantTag(iIndex, 0))
|
||||
{
|
||||
if (pType) *pType = 1;
|
||||
return pTag->Name.c_str();
|
||||
return pTag->m_sName.c_str();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -406,7 +406,8 @@ void CPlayerlistUtils::UpdatePlayers()
|
||||
H::Entities.IsFriend(uFriendsID),
|
||||
H::Entities.InParty(uFriendsID),
|
||||
H::Entities.IsF2P(uFriendsID),
|
||||
H::Entities.GetLevel(uFriendsID)
|
||||
H::Entities.GetLevel(uFriendsID),
|
||||
H::Entities.GetParty(uFriendsID)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -23,17 +23,18 @@ struct ListPlayer
|
||||
bool m_bParty;
|
||||
bool m_bF2P;
|
||||
int m_iLevel;
|
||||
uint64_t m_iParty;
|
||||
};
|
||||
|
||||
struct PriorityLabel_t
|
||||
{
|
||||
std::string Name = "";
|
||||
Color_t Color = {};
|
||||
int Priority = 0;
|
||||
std::string m_sName = "";
|
||||
Color_t m_tColor = {};
|
||||
int m_iPriority = 0;
|
||||
|
||||
bool Label = false;
|
||||
bool Assignable = true;
|
||||
bool Locked = false; // don't allow it to be removed
|
||||
bool m_bLabel = false;
|
||||
bool m_bAssignable = true;
|
||||
bool m_bLocked = false; // don't allow it to be removed
|
||||
};
|
||||
|
||||
class CPlayerlistUtils
|
||||
|
||||
@@ -46,7 +46,7 @@ std::optional<float> CResolver::GetPitchForSniperDot(CTFPlayer* pEntity, CTFPlay
|
||||
|
||||
void CResolver::FrameStageNotify()
|
||||
{
|
||||
if (!Vars::AntiHack::Resolver::Enabled.Value || !I::EngineClient->IsInGame() || I::EngineClient->IsPlayingDemo())
|
||||
if (!Vars::Resolver::Enabled.Value || !I::EngineClient->IsInGame() || I::EngineClient->IsPlayingDemo())
|
||||
return;
|
||||
|
||||
auto pResource = H::Entities.GetPR();
|
||||
@@ -95,22 +95,22 @@ void CResolver::CreateMove(CTFPlayer* pLocal)
|
||||
|
||||
float& flYaw = tData.m_flYaw;
|
||||
float& flPitch = tData.m_flPitch;
|
||||
bool bAutoYaw = tData.m_bAutoSetYaw && Vars::AntiHack::Resolver::AutoResolveYawAmount.Value;
|
||||
bool bAutoPitch = tData.m_bAutoSetPitch && Vars::AntiHack::Resolver::AutoResolvePitchAmount.Value;
|
||||
bool bAutoYaw = tData.m_bAutoSetYaw && Vars::Resolver::AutoResolveYawAmount.Value;
|
||||
bool bAutoPitch = tData.m_bAutoSetPitch && Vars::Resolver::AutoResolvePitchAmount.Value;
|
||||
|
||||
if (bAutoYaw)
|
||||
{
|
||||
flYaw = Math::NormalizeAngle(flYaw + Vars::AntiHack::Resolver::AutoResolveYawAmount.Value);
|
||||
flYaw = Math::NormalizeAngle(flYaw + Vars::Resolver::AutoResolveYawAmount.Value);
|
||||
|
||||
F::Backtrack.ResolverUpdate(pTarget);
|
||||
F::Output.ReportResolver(I::EngineClient->GetPlayerForUserID(m_iWaitingForTarget), "Cycling", "yaw", flYaw);
|
||||
}
|
||||
|
||||
if (bAutoPitch
|
||||
&& (!bAutoYaw || fabsf(flYaw) < fabsf(Vars::AntiHack::Resolver::AutoResolveYawAmount.Value / 2))
|
||||
&& (!bAutoYaw || fabsf(flYaw) < fabsf(Vars::Resolver::AutoResolveYawAmount.Value / 2))
|
||||
&& fabsf(pTarget->m_angEyeAnglesX()) == 90.f && !m_mSniperDots.contains(m_iWaitingForTarget))
|
||||
{
|
||||
flPitch = Math::NormalizeAngle(flPitch + Vars::AntiHack::Resolver::AutoResolvePitchAmount.Value, 180.f);
|
||||
flPitch = Math::NormalizeAngle(flPitch + Vars::Resolver::AutoResolvePitchAmount.Value, 180.f);
|
||||
|
||||
F::Backtrack.ResolverUpdate(pTarget);
|
||||
F::Output.ReportResolver(I::EngineClient->GetPlayerForUserID(m_iWaitingForTarget), "Cycling", "pitch", flPitch);
|
||||
@@ -122,7 +122,7 @@ void CResolver::CreateMove(CTFPlayer* pLocal)
|
||||
}
|
||||
}
|
||||
|
||||
if (!Vars::AntiHack::Resolver::Enabled.Value)
|
||||
if (!Vars::Resolver::Enabled.Value)
|
||||
return;
|
||||
|
||||
auto pResource = H::Entities.GetPR();
|
||||
@@ -156,7 +156,7 @@ void CResolver::CreateMove(CTFPlayer* pLocal)
|
||||
return pClosest;
|
||||
};
|
||||
|
||||
if (Vars::AntiHack::Resolver::CycleYaw.Value)
|
||||
if (Vars::Resolver::CycleYaw.Value)
|
||||
{
|
||||
if (SDK::PlatFloatTime() > m_flLastYawCycle + 0.5f)
|
||||
{
|
||||
@@ -166,7 +166,7 @@ void CResolver::CreateMove(CTFPlayer* pLocal)
|
||||
auto& tData = m_mResolverData[iUserID];
|
||||
|
||||
float& flYaw = tData.m_flYaw;
|
||||
flYaw = Math::NormalizeAngle(flYaw + Vars::AntiHack::Resolver::CycleYaw.Value);
|
||||
flYaw = Math::NormalizeAngle(flYaw + Vars::Resolver::CycleYaw.Value);
|
||||
|
||||
F::Backtrack.ResolverUpdate(pTarget);
|
||||
F::Output.ReportResolver(pTarget->entindex(), "Cycling", "yaw", flYaw);
|
||||
@@ -178,7 +178,7 @@ void CResolver::CreateMove(CTFPlayer* pLocal)
|
||||
else
|
||||
m_flLastYawCycle = 0.f;
|
||||
|
||||
if (Vars::AntiHack::Resolver::CyclePitch.Value)
|
||||
if (Vars::Resolver::CyclePitch.Value)
|
||||
{
|
||||
if (SDK::PlatFloatTime() > m_flLastPitchCycle + 0.5f)
|
||||
{
|
||||
@@ -192,8 +192,8 @@ void CResolver::CreateMove(CTFPlayer* pLocal)
|
||||
|
||||
float& flPitch = tData.m_flPitch;
|
||||
|
||||
flPitch += Vars::AntiHack::Resolver::CyclePitch.Value;
|
||||
flPitch = Math::NormalizeAngle(flPitch + Vars::AntiHack::Resolver::CyclePitch.Value, 180.f);
|
||||
flPitch += Vars::Resolver::CyclePitch.Value;
|
||||
flPitch = Math::NormalizeAngle(flPitch + Vars::Resolver::CyclePitch.Value, 180.f);
|
||||
|
||||
F::Backtrack.ResolverUpdate(pTarget);
|
||||
F::Output.ReportResolver(pTarget->entindex(), "Cycling", "pitch", flPitch);
|
||||
@@ -205,7 +205,7 @@ void CResolver::CreateMove(CTFPlayer* pLocal)
|
||||
else
|
||||
m_flLastPitchCycle = 0.f;
|
||||
|
||||
if (Vars::AntiHack::Resolver::CycleMinwalk.Value)
|
||||
if (Vars::Resolver::CycleMinwalk.Value)
|
||||
{
|
||||
if (SDK::PlatFloatTime() > m_flLastMinwalkCycle + 0.5f)
|
||||
{
|
||||
@@ -227,7 +227,7 @@ void CResolver::CreateMove(CTFPlayer* pLocal)
|
||||
else
|
||||
m_flLastMinwalkCycle = 0.f;
|
||||
|
||||
if (Vars::AntiHack::Resolver::CycleView.Value)
|
||||
if (Vars::Resolver::CycleView.Value)
|
||||
{
|
||||
if (SDK::PlatFloatTime() > m_flLastViewCycle + 0.5f)
|
||||
{
|
||||
@@ -252,14 +252,14 @@ void CResolver::CreateMove(CTFPlayer* pLocal)
|
||||
|
||||
void CResolver::HitscanRan(CTFPlayer* pLocal, CTFPlayer* pTarget, CTFWeaponBase* pWeapon, int iHitbox)
|
||||
{
|
||||
if (!Vars::AntiHack::Resolver::Enabled.Value || !Vars::AntiHack::Resolver::AutoResolve.Value
|
||||
if (!Vars::Resolver::Enabled.Value || !Vars::Resolver::AutoResolve.Value
|
||||
|| Vars::Aimbot::General::AimType.Value == Vars::Aimbot::General::AimTypeEnum::Smooth || pLocal->m_iTeamNum() == pTarget->m_iTeamNum())
|
||||
return;
|
||||
|
||||
if (Vars::AntiHack::Resolver::AutoResolveCheatersOnly.Value && !F::PlayerUtils.HasTag(pTarget->entindex(), CHEATER_TAG))
|
||||
if (Vars::Resolver::AutoResolveCheatersOnly.Value && !F::PlayerUtils.HasTag(pTarget->entindex(), CHEATER_TAG))
|
||||
return;
|
||||
|
||||
if (Vars::AntiHack::Resolver::AutoResolveHeadshotOnly.Value && (iHitbox != HITBOX_HEAD || !G::CanHeadshot))
|
||||
if (Vars::Resolver::AutoResolveHeadshotOnly.Value && (iHitbox != HITBOX_HEAD || !G::CanHeadshot))
|
||||
return;
|
||||
|
||||
if (pWeapon->GetWeaponSpread())
|
||||
@@ -381,7 +381,7 @@ void CResolver::SetView(int iUserID, bool bValue)
|
||||
|
||||
bool CResolver::GetAngles(CTFPlayer* pPlayer, float* pYaw, float* pPitch, bool* pMinwalk, bool bFake)
|
||||
{
|
||||
if (!Vars::AntiHack::Resolver::Enabled.Value)
|
||||
if (!Vars::Resolver::Enabled.Value)
|
||||
return false;
|
||||
|
||||
if (pPlayer->entindex() == I::EngineClient->GetLocalPlayer() || pPlayer->IsDormant() || !pPlayer->IsAlive() || pPlayer->IsAGhost())
|
||||
|
||||
@@ -204,7 +204,7 @@ void CMovementSimulation::Store()
|
||||
|
||||
|
||||
|
||||
bool CMovementSimulation::Initialize(CBaseEntity* pEntity, PlayerStorage& tStorage, bool useHitchance, bool cancelStrafe)
|
||||
bool CMovementSimulation::Initialize(CBaseEntity* pEntity, PlayerStorage& tStorage, bool bHitchance, bool bStrafe)
|
||||
{
|
||||
if (!pEntity || !pEntity->IsPlayer() || !pEntity->As<CTFPlayer>()->IsAlive())
|
||||
{
|
||||
@@ -264,10 +264,10 @@ bool CMovementSimulation::Initialize(CBaseEntity* pEntity, PlayerStorage& tStora
|
||||
: Vars::Aimbot::Projectile::AirSamples.Value;
|
||||
|
||||
// calculate strafe if desired
|
||||
bool bCalculated = cancelStrafe ? false : StrafePrediction(tStorage, iStrafeSamples);
|
||||
bool bCalculated = bStrafe ? StrafePrediction(tStorage, iStrafeSamples) : false;
|
||||
|
||||
// really hope this doesn't work like shit
|
||||
if (useHitchance && bCalculated && !pPlayer->m_vecVelocity().IsZero() && Vars::Aimbot::Projectile::Hitchance.Value)
|
||||
if (bHitchance && bCalculated && !pPlayer->m_vecVelocity().IsZero() && Vars::Aimbot::Projectile::HitChance.Value)
|
||||
{
|
||||
const auto& vRecords = mRecords[pPlayer->entindex()];
|
||||
const auto iSamples = vRecords.size();
|
||||
@@ -297,9 +297,9 @@ bool CMovementSimulation::Initialize(CBaseEntity* pEntity, PlayerStorage& tStora
|
||||
}
|
||||
}
|
||||
|
||||
if (flCurrentChance < Vars::Aimbot::Projectile::Hitchance.Value / 100)
|
||||
if (flCurrentChance < Vars::Aimbot::Projectile::HitChance.Value / 100)
|
||||
{
|
||||
SDK::Output("MovementSimulation", std::format("Hitchance ({}% < {}%)", flCurrentChance * 100, Vars::Aimbot::Projectile::Hitchance.Value).c_str(), { 80, 200, 120 }, Vars::Debug::Logging.Value);
|
||||
SDK::Output("MovementSimulation", std::format("Hitchance ({}% < {}%)", flCurrentChance * 100, Vars::Aimbot::Projectile::HitChance.Value).c_str(), { 80, 200, 120 }, Vars::Debug::Logging.Value);
|
||||
|
||||
tStorage.m_bFailed = true;
|
||||
return false;
|
||||
@@ -377,11 +377,15 @@ static inline float GetGravity()
|
||||
return sv_gravity->GetFloat();
|
||||
}
|
||||
|
||||
static inline float GetFrictionScale(float flVelocityXY, float flTurn, float flVelocityZ, float flMin = 500.f, float flMax = 1500.f)
|
||||
static inline float GetFrictionScale(float flVelocityXY, float flTurn, float flVelocityZ, float flMin = 50.f, float flMax = 150.f)
|
||||
{
|
||||
if (0.f >= flVelocityZ || flVelocityZ > 250.f)
|
||||
return 1.f;
|
||||
|
||||
static auto sv_airaccelerate = U::ConVars.FindVar("sv_airaccelerate");
|
||||
float flScale = std::max(sv_airaccelerate->GetFloat(), 1.f);
|
||||
flMin *= flScale, flMax *= flScale;
|
||||
|
||||
// entity friction will be 0.25f if velocity is between 0.f and 250.f
|
||||
return Math::RemapVal(fabsf(flVelocityXY * flTurn), flMin, flMax, 1.f, 0.25f);
|
||||
}
|
||||
@@ -411,7 +415,7 @@ static inline void VisualizeRecords(MoveData& tRecord1, MoveData& tRecord2, Colo
|
||||
Vec3 vVelocity = tRecord1.m_vVelocity.To2D().Normalized() * 5;
|
||||
vVelocity = Math::RotatePoint(vVelocity, {}, { 0, flYaw > 0 ? 90.f : -90.f, 0 });
|
||||
if (Vars::Aimbot::Projectile::MovesimFrictionFlags.Value & Vars::Aimbot::Projectile::MovesimFrictionFlagsEnum::CalculateIncrease && tRecord1.m_iMode == 1)
|
||||
vVelocity /= GetFrictionScale(tRecord1.m_vVelocity.Length2D(), flYaw, tRecord1.m_vVelocity.z + GetGravity() * TICK_INTERVAL, 0.f, 560.f);
|
||||
vVelocity /= GetFrictionScale(tRecord1.m_vVelocity.Length2D(), flYaw, tRecord1.m_vVelocity.z + GetGravity() * TICK_INTERVAL, 0.f, 56.f);
|
||||
G::LineStorage.emplace_back(std::pair<Vec3, Vec3>(tRecord1.m_vOrigin, tRecord1.m_vOrigin + vVelocity), I::GlobalVars->curtime + 5.f, tColor);
|
||||
}
|
||||
}
|
||||
@@ -427,7 +431,7 @@ static bool GetYawDifference(MoveData& tRecord1, MoveData& tRecord2, bool bStart
|
||||
if (flMaxSpeed && tRecord1.m_iMode != 1)
|
||||
*pYaw *= std::clamp(tRecord1.m_vVelocity.Length2D() / flMaxSpeed, 0.f, 1.f);
|
||||
if (Vars::Aimbot::Projectile::MovesimFrictionFlags.Value & Vars::Aimbot::Projectile::MovesimFrictionFlagsEnum::CalculateIncrease && tRecord1.m_iMode == 1)
|
||||
*pYaw /= GetFrictionScale(tRecord1.m_vVelocity.Length2D(), *pYaw, tRecord1.m_vVelocity.z + GetGravity() * TICK_INTERVAL, 0.f, 560.f);
|
||||
*pYaw /= GetFrictionScale(tRecord1.m_vVelocity.Length2D(), *pYaw, tRecord1.m_vVelocity.z + GetGravity() * TICK_INTERVAL, 0.f, 56.f);
|
||||
if (fabsf(*pYaw) > 45.f)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ private:
|
||||
public:
|
||||
void Store();
|
||||
|
||||
bool Initialize(CBaseEntity* pEntity, PlayerStorage& tStorage, bool useHitchance = true, bool cancelStrafe = false);
|
||||
bool Initialize(CBaseEntity* pEntity, PlayerStorage& tStorage, bool bHitchance = true, bool bStrafe = true);
|
||||
bool SetDuck(PlayerStorage& tStorage, bool bDuck);
|
||||
void RunTick(PlayerStorage& tStorage, bool bPath = true, std::function<void(CMoveData&)>* pCallback = nullptr);
|
||||
void RunTick(PlayerStorage& tStorage, bool bPath, std::function<void(CMoveData&)> fCallback);
|
||||
|
||||
@@ -71,7 +71,7 @@ bool CProjectileSimulation::GetInfoMain(CTFPlayer* pPlayer, CTFWeaponBase* pWeap
|
||||
|
||||
if (Vars::Visuals::Trajectory::Override.Value)
|
||||
{
|
||||
SDK::GetProjectileFireSetup(pPlayer, vAngles, { Vars::Visuals::Trajectory::OffX.Value, Vars::Visuals::Trajectory::OffY.Value, Vars::Visuals::Trajectory::OffZ.Value }, vPos, vAngle, !bTrace ? true : Vars::Visuals::Trajectory::Pipes.Value, bQuick);
|
||||
SDK::GetProjectileFireSetup(pPlayer, vAngles, { Vars::Visuals::Trajectory::OffsetX.Value, Vars::Visuals::Trajectory::OffsetY.Value, Vars::Visuals::Trajectory::OffsetZ.Value }, vPos, vAngle, !bTrace ? true : Vars::Visuals::Trajectory::Pipes.Value, bQuick);
|
||||
tProjInfo = { FNV1A::Hash32Const("custom"), vPos, vAngle, { Vars::Visuals::Trajectory::Hull.Value, Vars::Visuals::Trajectory::Hull.Value, Vars::Visuals::Trajectory::Hull.Value }, Vars::Visuals::Trajectory::Speed.Value, Vars::Visuals::Trajectory::Gravity.Value, Vars::Visuals::Trajectory::NoSpin.Value, Vars::Visuals::Trajectory::LifeTime.Value };
|
||||
return true;
|
||||
}
|
||||
@@ -358,8 +358,8 @@ bool CProjectileSimulation::Initialize(ProjectileInfo& tProjInfo, bool bSimulate
|
||||
{
|
||||
case FNV1A::Hash32Const("custom"):
|
||||
flDrag = Vars::Visuals::Trajectory::Drag.Value;
|
||||
vDragBasis = { Vars::Visuals::Trajectory::DragBasisX.Value, Vars::Visuals::Trajectory::DragBasisY.Value, Vars::Visuals::Trajectory::DragBasisZ.Value };
|
||||
vAngDragBasis = { Vars::Visuals::Trajectory::AngDragBasisX.Value, Vars::Visuals::Trajectory::AngDragBasisY.Value, Vars::Visuals::Trajectory::AngDragBasisZ.Value };
|
||||
vDragBasis = { Vars::Visuals::Trajectory::DragX.Value, Vars::Visuals::Trajectory::DragY.Value, Vars::Visuals::Trajectory::DragZ.Value };
|
||||
vAngDragBasis = { Vars::Visuals::Trajectory::AngularDragX.Value, Vars::Visuals::Trajectory::AngularDragY.Value, Vars::Visuals::Trajectory::AngularDragZ.Value };
|
||||
break;
|
||||
case FNV1A::Hash32Const("models/weapons/w_models/w_grenade_grenadelauncher.mdl"):
|
||||
case FNV1A::Hash32Const("models/workshop/weapons/c_models/c_quadball/w_quadball_grenade.mdl"):
|
||||
@@ -447,7 +447,7 @@ bool CProjectileSimulation::Initialize(ProjectileInfo& tProjInfo, bool bSimulate
|
||||
{
|
||||
case FNV1A::Hash32Const("custom"):
|
||||
vVelocity += vUp * Vars::Visuals::Trajectory::UpVelocity.Value;
|
||||
vAngularVelocity = { Vars::Visuals::Trajectory::AngVelocityX.Value, Vars::Visuals::Trajectory::AngVelocityY.Value, Vars::Visuals::Trajectory::AngVelocityZ.Value };
|
||||
vAngularVelocity = { Vars::Visuals::Trajectory::AngularVelocityX.Value, Vars::Visuals::Trajectory::AngularVelocityY.Value, Vars::Visuals::Trajectory::AngularVelocityZ.Value };
|
||||
break;
|
||||
case FNV1A::Hash32Const("models/weapons/w_models/w_grenade_grenadelauncher.mdl"):
|
||||
case FNV1A::Hash32Const("models/workshop/weapons/c_models/c_quadball/w_quadball_grenade.mdl"):
|
||||
|
||||
@@ -38,9 +38,9 @@ void CSpectate::NetUpdateEnd(CTFPlayer* pLocal)
|
||||
default:
|
||||
pLocal->m_hObserverTarget().Set(pEntity);
|
||||
}
|
||||
pLocal->m_iObserverMode() = Vars::Visuals::ThirdPerson::Enabled.Value ? OBS_MODE_THIRDPERSON : OBS_MODE_FIRSTPERSON;
|
||||
pLocal->m_iObserverMode() = Vars::Visuals::Thirdperson::Enabled.Value ? OBS_MODE_THIRDPERSON : OBS_MODE_FIRSTPERSON;
|
||||
pLocal->m_vecViewOffset() = pEntity->GetViewOffset();
|
||||
Vars::Visuals::ThirdPerson::Enabled.Value ? I::Input->CAM_ToThirdPerson() : I::Input->CAM_ToFirstPerson();
|
||||
Vars::Visuals::Thirdperson::Enabled.Value ? I::Input->CAM_ToThirdPerson() : I::Input->CAM_ToFirstPerson();
|
||||
|
||||
m_pTargetTarget = pLocal->m_hObserverTarget().Get();
|
||||
m_iTargetMode = pLocal->m_iObserverMode();
|
||||
|
||||
@@ -20,10 +20,10 @@ void CTickshiftHandler::Recharge(CTFPlayer* pLocal)
|
||||
|
||||
static float flPassiveTime = 0.f;
|
||||
flPassiveTime = std::max(flPassiveTime - TICK_INTERVAL, -TICK_INTERVAL);
|
||||
if (Vars::CL_Move::Doubletap::PassiveRecharge.Value && 0.f >= flPassiveTime)
|
||||
if (Vars::Doubletap::PassiveRecharge.Value && 0.f >= flPassiveTime)
|
||||
{
|
||||
bPassive = true;
|
||||
flPassiveTime += 1.f / Vars::CL_Move::Doubletap::PassiveRecharge.Value;
|
||||
flPassiveTime += 1.f / Vars::Doubletap::PassiveRecharge.Value;
|
||||
}
|
||||
|
||||
if (m_iDeficit)
|
||||
@@ -32,7 +32,7 @@ void CTickshiftHandler::Recharge(CTFPlayer* pLocal)
|
||||
m_iDeficit--, m_iShiftedTicks--;
|
||||
}
|
||||
|
||||
if (!Vars::CL_Move::Doubletap::RechargeTicks.Value && !bPassive
|
||||
if (!Vars::Doubletap::RechargeTicks.Value && !bPassive
|
||||
|| m_bDoubletap || m_bWarp || m_iShiftedTicks == m_iMaxShift || m_bSpeedhack)
|
||||
return;
|
||||
|
||||
@@ -46,12 +46,12 @@ void CTickshiftHandler::Warp()
|
||||
return;
|
||||
|
||||
m_bWarp = false;
|
||||
if (!Vars::CL_Move::Doubletap::Warp.Value
|
||||
if (!Vars::Doubletap::Warp.Value
|
||||
|| !m_iShiftedTicks || m_bDoubletap || m_bRecharge || m_bSpeedhack)
|
||||
return;
|
||||
|
||||
m_bWarp = true;
|
||||
m_iShiftedGoal = std::max(m_iShiftedTicks - Vars::CL_Move::Doubletap::WarpRate.Value + 1, 0);
|
||||
m_iShiftedGoal = std::max(m_iShiftedTicks - Vars::Doubletap::WarpRate.Value + 1, 0);
|
||||
}
|
||||
|
||||
void CTickshiftHandler::Doubletap(CTFPlayer* pLocal, CUserCmd* pCmd)
|
||||
@@ -59,13 +59,13 @@ void CTickshiftHandler::Doubletap(CTFPlayer* pLocal, CUserCmd* pCmd)
|
||||
if (!m_bGoalReached)
|
||||
return;
|
||||
|
||||
if (!Vars::CL_Move::Doubletap::Doubletap.Value
|
||||
if (!Vars::Doubletap::Doubletap.Value
|
||||
|| m_iWait || m_bWarp || m_bRecharge || m_bSpeedhack)
|
||||
return;
|
||||
|
||||
int iTicks = std::min(m_iShiftedTicks + 1, 22);
|
||||
auto pWeapon = H::Entities.GetWeapon();
|
||||
if (!(iTicks >= Vars::CL_Move::Doubletap::TickLimit.Value || pWeapon && GetShotsWithinPacket(pWeapon, iTicks) > 1))
|
||||
if (!(iTicks >= Vars::Doubletap::TickLimit.Value || pWeapon && GetShotsWithinPacket(pWeapon, iTicks) > 1))
|
||||
return;
|
||||
|
||||
bool bAttacking = G::PrimaryWeaponType == EWeaponType::MELEE ? pCmd->buttons & IN_ATTACK : G::Attacking;
|
||||
@@ -73,14 +73,14 @@ void CTickshiftHandler::Doubletap(CTFPlayer* pLocal, CUserCmd* pCmd)
|
||||
return;
|
||||
|
||||
m_bDoubletap = true;
|
||||
m_iShiftedGoal = std::max(m_iShiftedTicks - Vars::CL_Move::Doubletap::TickLimit.Value + 1, 0);
|
||||
if (Vars::CL_Move::Doubletap::AntiWarp.Value)
|
||||
m_iShiftedGoal = std::max(m_iShiftedTicks - Vars::Doubletap::TickLimit.Value + 1, 0);
|
||||
if (Vars::Doubletap::AntiWarp.Value)
|
||||
m_bAntiWarp = pLocal->m_hGroundEntity();
|
||||
}
|
||||
|
||||
void CTickshiftHandler::Speedhack()
|
||||
{
|
||||
m_bSpeedhack = Vars::CL_Move::SpeedEnabled.Value;
|
||||
m_bSpeedhack = Vars::Speedhack::Enabled.Value;
|
||||
if (!m_bSpeedhack)
|
||||
return;
|
||||
|
||||
@@ -214,7 +214,7 @@ void CTickshiftHandler::CLMoveFunc(float accumulated_extra_samples, bool bFinalT
|
||||
|
||||
int iTicks = std::min(m_iShiftedTicks + 1, 22);
|
||||
auto pWeapon = H::Entities.GetWeapon();
|
||||
if (!(iTicks >= Vars::CL_Move::Doubletap::TickLimit.Value || pWeapon && GetShotsWithinPacket(pWeapon, iTicks) > 1))
|
||||
if (!(iTicks >= Vars::Doubletap::TickLimit.Value || pWeapon && GetShotsWithinPacket(pWeapon, iTicks) > 1))
|
||||
m_iWait = 1;
|
||||
|
||||
m_bGoalReached = bFinalTick && m_iShiftedTicks == m_iShiftedGoal;
|
||||
@@ -232,13 +232,13 @@ void CTickshiftHandler::CLMove(float accumulated_extra_samples, bool bFinalTick)
|
||||
case TF_WEAPON_PIPEBOMBLAUNCHER:
|
||||
case TF_WEAPON_CANNON:
|
||||
if (!G::CanSecondaryAttack)
|
||||
m_iWait = Vars::CL_Move::Doubletap::TickLimit.Value;
|
||||
m_iWait = Vars::Doubletap::TickLimit.Value;
|
||||
break;
|
||||
default:
|
||||
if (!ValidWeapon(pWeapon))
|
||||
m_iWait = 2;
|
||||
else if (G::Attacking || !G::CanPrimaryAttack && !G::Reloading)
|
||||
m_iWait = Vars::CL_Move::Doubletap::TickLimit.Value;
|
||||
m_iWait = Vars::Doubletap::TickLimit.Value;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -248,7 +248,7 @@ void CTickshiftHandler::CLMove(float accumulated_extra_samples, bool bFinalTick)
|
||||
m_iMaxShift = sv_maxusrcmdprocessticks->GetInt();
|
||||
if (Vars::Misc::Game::AntiCheatCompatibility.Value)
|
||||
m_iMaxShift = std::min(m_iMaxShift, 8);
|
||||
m_iMaxShift -= std::max(24 - std::clamp(Vars::CL_Move::Doubletap::RechargeLimit.Value, 1, 24), F::AntiAim.YawOn() ? F::AntiAim.AntiAimTicks() : 0);
|
||||
m_iMaxShift -= std::max(24 - std::clamp(Vars::Doubletap::RechargeLimit.Value, 1, 24), F::AntiAim.YawOn() ? F::AntiAim.AntiAimTicks() : 0);
|
||||
|
||||
while (m_iShiftedTicks > m_iMaxShift)
|
||||
CLMoveFunc(accumulated_extra_samples, false); // skim any excess ticks
|
||||
@@ -262,7 +262,7 @@ void CTickshiftHandler::CLMove(float accumulated_extra_samples, bool bFinalTick)
|
||||
|
||||
if (m_bSpeedhack)
|
||||
{
|
||||
m_iShiftedTicks = Vars::CL_Move::SpeedFactor.Value;
|
||||
m_iShiftedTicks = Vars::Speedhack::Factor.Value;
|
||||
m_iShiftedGoal = 0;
|
||||
}
|
||||
|
||||
@@ -348,7 +348,7 @@ void CTickshiftHandler::ManagePacket(CUserCmd* pCmd, bool* pSendPacket)
|
||||
|
||||
*pSendPacket = m_iShiftedGoal == m_iShiftedTicks;
|
||||
if (I::ClientState->chokedcommands >= 21 // prevent overchoking
|
||||
|| m_iShiftedTicks == m_iShiftedGoal + Vars::CL_Move::Doubletap::TickLimit.Value - 1 && I::ClientState->chokedcommands) // unchoke if we are choking
|
||||
|| m_iShiftedTicks == m_iShiftedGoal + Vars::Doubletap::TickLimit.Value - 1 && I::ClientState->chokedcommands) // unchoke if we are choking
|
||||
*pSendPacket = true;
|
||||
}
|
||||
|
||||
@@ -357,15 +357,15 @@ int CTickshiftHandler::GetTicks(CTFWeaponBase* pWeapon)
|
||||
if (m_bDoubletap && m_iShiftedGoal < m_iShiftedTicks)
|
||||
return m_iShiftedTicks - m_iShiftedGoal;
|
||||
|
||||
if (!Vars::CL_Move::Doubletap::Doubletap.Value
|
||||
if (!Vars::Doubletap::Doubletap.Value
|
||||
|| m_iWait || m_bWarp || m_bRecharge || m_bSpeedhack || F::AutoRocketJump.IsRunning())
|
||||
return 0;
|
||||
|
||||
int iTicks = std::min(m_iShiftedTicks + 1, 22);
|
||||
if (!(iTicks >= Vars::CL_Move::Doubletap::TickLimit.Value || pWeapon && GetShotsWithinPacket(pWeapon, iTicks) > 1))
|
||||
if (!(iTicks >= Vars::Doubletap::TickLimit.Value || pWeapon && GetShotsWithinPacket(pWeapon, iTicks) > 1))
|
||||
return 0;
|
||||
|
||||
return std::min(Vars::CL_Move::Doubletap::TickLimit.Value - 1, m_iMaxShift);
|
||||
return std::min(Vars::Doubletap::TickLimit.Value - 1, m_iMaxShift);
|
||||
}
|
||||
|
||||
int CTickshiftHandler::GetShotsWithinPacket(CTFWeaponBase* pWeapon, int iTicks)
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
void AntiWarp(CTFPlayer* pLocal, CUserCmd* pCmd);
|
||||
|
||||
int GetTicks(CTFWeaponBase* pWeapon = nullptr);
|
||||
int GetShotsWithinPacket(CTFWeaponBase* pWeapon, int iTicks = Vars::CL_Move::Doubletap::TickLimit.Value);
|
||||
int GetShotsWithinPacket(CTFWeaponBase* pWeapon, int iTicks = Vars::Doubletap::TickLimit.Value);
|
||||
int GetMinimumTicksNeeded(CTFWeaponBase* pWeapon);
|
||||
bool CanChoke();
|
||||
|
||||
|
||||
@@ -17,8 +17,11 @@ static inline bool GetPlayerChams(CBaseEntity* pPlayer, CBaseEntity* pEntity, CT
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!Vars::Chams::Player::Relative.Value)
|
||||
if (!Vars::Chams::Relative.Value)
|
||||
{
|
||||
if (pEntity->m_iTeamNum() != pLocal->m_iTeamNum() ? !Vars::Chams::EnemyChams.Value : !Vars::Chams::TeamChams.Value)
|
||||
return false;
|
||||
|
||||
switch (pEntity->m_iTeamNum())
|
||||
{
|
||||
case TF_TEAM_BLUE:
|
||||
@@ -28,7 +31,6 @@ static inline bool GetPlayerChams(CBaseEntity* pPlayer, CBaseEntity* pEntity, CT
|
||||
*pChams = Chams_t(Vars::Chams::Team::Visible.Value, Vars::Chams::Team::Occluded.Value);
|
||||
return bTeam;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -43,6 +45,7 @@ static inline bool GetPlayerChams(CBaseEntity* pPlayer, CBaseEntity* pEntity, CT
|
||||
return bTeam;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CChams::GetChams(CTFPlayer* pLocal, CBaseEntity* pEntity, Chams_t* pChams)
|
||||
@@ -65,26 +68,6 @@ bool CChams::GetChams(CTFPlayer* pLocal, CBaseEntity* pEntity, Chams_t* pChams)
|
||||
|
||||
return GetPlayerChams(pOwner, pEntity, pLocal, pChams, Vars::Chams::Enemy::Buildings.Value, Vars::Chams::Team::Buildings.Value);
|
||||
}
|
||||
// ragdoll chams
|
||||
case ETFClassID::CTFRagdoll:
|
||||
case ETFClassID::CRagdollProp:
|
||||
case ETFClassID::CRagdollPropAttached:
|
||||
{
|
||||
/*
|
||||
// don't interfere with ragdolls
|
||||
if (Vars::Visuals::Ragdolls::Type.Value)
|
||||
{
|
||||
if (Vars::Visuals::Ragdolls::EnemyOnly.Value && pEntity && pLocal && pEntity->m_iTeamNum() == pLocal->m_iTeamNum())
|
||||
return false;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
auto pOwner = pEntity->As<CTFRagdoll>()->m_hPlayer().Get();
|
||||
if (!pOwner) pOwner = pEntity;
|
||||
|
||||
return GetPlayerChams(pOwner, pEntity, pLocal, pChams, Vars::Chams::Enemy::Ragdolls.Value, Vars::Chams::Team::Ragdolls.Value);
|
||||
}
|
||||
// projectile chams
|
||||
case ETFClassID::CBaseProjectile:
|
||||
case ETFClassID::CBaseGrenade:
|
||||
@@ -147,6 +130,16 @@ bool CChams::GetChams(CTFPlayer* pLocal, CBaseEntity* pEntity, Chams_t* pChams)
|
||||
|
||||
return GetPlayerChams(pOwner, pEntity, pLocal, pChams, Vars::Chams::Enemy::Projectiles.Value, Vars::Chams::Team::Projectiles.Value);
|
||||
}
|
||||
// ragdoll chams
|
||||
case ETFClassID::CTFRagdoll:
|
||||
case ETFClassID::CRagdollProp:
|
||||
case ETFClassID::CRagdollPropAttached:
|
||||
{
|
||||
auto pOwner = pEntity->As<CTFRagdoll>()->m_hPlayer().Get();
|
||||
if (!pOwner) pOwner = pEntity;
|
||||
|
||||
return GetPlayerChams(pOwner, pEntity, pLocal, pChams, Vars::Chams::Enemy::Ragdolls.Value, Vars::Chams::Team::Ragdolls.Value);
|
||||
}
|
||||
// objective chams
|
||||
case ETFClassID::CCaptureFlag:
|
||||
*pChams = Chams_t(Vars::Chams::World::Visible.Value, Vars::Chams::World::Occluded.Value);
|
||||
@@ -244,10 +237,10 @@ void CChams::StencilEnd(IMatRenderContext* pRenderContext, bool bTwoModels)
|
||||
pRenderContext->DepthRange(0.f, 1.f);
|
||||
}
|
||||
|
||||
void CChams::DrawModel(CBaseEntity* pEntity, Chams_t chams, IMatRenderContext* pRenderContext, bool bExtra)
|
||||
void CChams::DrawModel(CBaseEntity* pEntity, Chams_t& tChams, IMatRenderContext* pRenderContext, bool bExtra)
|
||||
{
|
||||
auto vVisibleMaterials = chams.Visible.size() ? chams.Visible : std::vector<std::pair<std::string, Color_t>> { { "None", {} } };
|
||||
auto vOccludedMaterials = chams.Occluded.size() ? chams.Occluded : std::vector<std::pair<std::string, Color_t>> { { "None", {} } };
|
||||
auto vVisibleMaterials = tChams.Visible.size() ? tChams.Visible : std::vector<std::pair<std::string, Color_t>> { { "None", {} } };
|
||||
auto vOccludedMaterials = tChams.Occluded.size() ? tChams.Occluded : std::vector<std::pair<std::string, Color_t>> { { "None", {} } };
|
||||
|
||||
StencilBegin(pRenderContext, !bExtra);
|
||||
|
||||
@@ -262,9 +255,9 @@ void CChams::DrawModel(CBaseEntity* pEntity, Chams_t chams, IMatRenderContext* p
|
||||
if (pMaterial && pMaterial->m_bInvertCull)
|
||||
pRenderContext->CullMode(MATERIAL_CULLMODE_CW);
|
||||
|
||||
bRendering = true;
|
||||
m_bRendering = true;
|
||||
pEntity->DrawModel(STUDIO_RENDER);
|
||||
bRendering = false;
|
||||
m_bRendering = false;
|
||||
|
||||
if (pMaterial && pMaterial->m_bInvertCull)
|
||||
pRenderContext->CullMode(MATERIAL_CULLMODE_CCW);
|
||||
@@ -282,9 +275,9 @@ void CChams::DrawModel(CBaseEntity* pEntity, Chams_t chams, IMatRenderContext* p
|
||||
if (pMaterial && pMaterial->m_bInvertCull)
|
||||
pRenderContext->CullMode(MATERIAL_CULLMODE_CW);
|
||||
|
||||
bRendering = true;
|
||||
m_bRendering = true;
|
||||
pEntity->DrawModel(STUDIO_RENDER);
|
||||
bRendering = false;
|
||||
m_bRendering = false;
|
||||
|
||||
if (pMaterial && pMaterial->m_bInvertCull)
|
||||
pRenderContext->CullMode(MATERIAL_CULLMODE_CCW);
|
||||
@@ -297,14 +290,14 @@ void CChams::DrawModel(CBaseEntity* pEntity, Chams_t chams, IMatRenderContext* p
|
||||
I::ModelRender->ForcedMaterialOverride(nullptr);
|
||||
|
||||
if (!bExtra)
|
||||
mEntities[pEntity->entindex()] = true;
|
||||
m_mEntities[pEntity->entindex()] = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CChams::Store(CTFPlayer* pLocal)
|
||||
{
|
||||
vEntities.clear();
|
||||
m_vEntities.clear();
|
||||
if (!pLocal)
|
||||
return;
|
||||
|
||||
@@ -317,7 +310,7 @@ void CChams::Store(CTFPlayer* pLocal)
|
||||
Chams_t tChams = {};
|
||||
if (GetChams(pLocal, pEntity, &tChams)
|
||||
&& SDK::IsOnScreen(pEntity, !H::Entities.IsProjectile(pEntity) /*&& pEntity->GetClassID() != ETFClassID::CTFMedigunShield*/))
|
||||
vEntities.emplace_back(pEntity, tChams);
|
||||
m_vEntities.emplace_back(pEntity, tChams);
|
||||
|
||||
if (pEntity->IsPlayer() && !pEntity->IsDormant())
|
||||
{
|
||||
@@ -341,7 +334,7 @@ void CChams::Store(CTFPlayer* pLocal)
|
||||
if (bShowEnemy && pEntity->m_iTeamNum() != pLocal->m_iTeamNum() || bShowFriendly && pEntity->m_iTeamNum() == pLocal->m_iTeamNum())
|
||||
{
|
||||
tChams = Chams_t(Vars::Chams::Backtrack::Visible.Value, {});
|
||||
vEntities.emplace_back(pEntity, tChams, true);
|
||||
m_vEntities.emplace_back(pEntity, tChams, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -350,7 +343,7 @@ void CChams::Store(CTFPlayer* pLocal)
|
||||
if (Vars::Chams::FakeAngle::Enabled.Value && pEntity == pLocal && F::FakeAngle.bDrawChams && F::FakeAngle.bBonesSetup)
|
||||
{
|
||||
tChams = Chams_t(Vars::Chams::FakeAngle::Visible.Value, {});
|
||||
vEntities.emplace_back(pEntity, tChams, true);
|
||||
m_vEntities.emplace_back(pEntity, tChams, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -362,13 +355,13 @@ void CChams::RenderMain()
|
||||
if (!pRenderContext)
|
||||
return;
|
||||
|
||||
for (auto& tInfo : vEntities)
|
||||
for (auto& tInfo : m_vEntities)
|
||||
{
|
||||
if (!tInfo.m_bExtra)
|
||||
DrawModel(tInfo.m_pEntity, tInfo.m_tChams, pRenderContext, tInfo.m_bExtra);
|
||||
else
|
||||
{
|
||||
bExtra = true;
|
||||
m_bExtra = true;
|
||||
|
||||
auto pPlayer = tInfo.m_pEntity->As<CTFPlayer>();
|
||||
|
||||
@@ -379,7 +372,7 @@ void CChams::RenderMain()
|
||||
|
||||
pPlayer->m_flInvisibility() = flOldInvisibility;
|
||||
|
||||
bExtra = false;
|
||||
m_bExtra = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -467,7 +460,7 @@ void CChams::RenderFakeAngle(const DrawModelState_t& pState, const ModelRenderIn
|
||||
}
|
||||
void CChams::RenderHandler(const DrawModelState_t& pState, const ModelRenderInfo_t& pInfo, matrix3x4* pBoneToWorld)
|
||||
{
|
||||
if (!bExtra)
|
||||
if (!m_bExtra)
|
||||
{
|
||||
static auto ModelRender_DrawModelExecute = U::Hooks.m_mHooks["IVModelRender_DrawModelExecute"];
|
||||
if (ModelRender_DrawModelExecute)
|
||||
@@ -494,7 +487,7 @@ bool CChams::RenderViewmodel(void* ecx, int flags, int* iReturn)
|
||||
|
||||
|
||||
|
||||
auto& vMaterials = Vars::Chams::Viewmodel::WeaponVisible.Value;
|
||||
auto& vMaterials = Vars::Chams::Viewmodel::WeaponMaterial.Value;
|
||||
|
||||
for (auto& [sName, tColor] : vMaterials)
|
||||
{
|
||||
@@ -530,7 +523,7 @@ bool CChams::RenderViewmodel(const DrawModelState_t& pState, const ModelRenderIn
|
||||
|
||||
|
||||
|
||||
auto& vMaterials = Vars::Chams::Viewmodel::HandsVisible.Value;
|
||||
auto& vMaterials = Vars::Chams::Viewmodel::HandsMaterial.Value;
|
||||
|
||||
for (auto& [sName, tColor] : vMaterials)
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ class CChams
|
||||
void StencilOccluded(IMatRenderContext* pRenderContext);
|
||||
void StencilEnd(IMatRenderContext* pRenderContext, bool bTwoModels = false);
|
||||
|
||||
void DrawModel(CBaseEntity* pEntity, Chams_t chams, IMatRenderContext* pRenderContext, bool bExtra = false);
|
||||
void DrawModel(CBaseEntity* pEntity, Chams_t& tChams, IMatRenderContext* pRenderContext, bool bExtra = false);
|
||||
|
||||
void RenderBacktrack(const DrawModelState_t& pState, const ModelRenderInfo_t& pInfo);
|
||||
void RenderFakeAngle(const DrawModelState_t& pState, const ModelRenderInfo_t& pInfo);
|
||||
@@ -21,9 +21,9 @@ class CChams
|
||||
Chams_t m_tChams;
|
||||
bool m_bExtra = false;
|
||||
};
|
||||
std::vector<ChamsInfo_t> vEntities = {};
|
||||
std::vector<ChamsInfo_t> m_vEntities = {};
|
||||
|
||||
bool bExtra = false;
|
||||
bool m_bExtra = false;
|
||||
|
||||
public:
|
||||
void Store(CTFPlayer* pLocal);
|
||||
@@ -33,9 +33,9 @@ public:
|
||||
bool RenderViewmodel(void* ecx, int flags, int* iReturn);
|
||||
bool RenderViewmodel(const DrawModelState_t& pState, const ModelRenderInfo_t& pInfo, matrix3x4* pBoneToWorld);
|
||||
|
||||
bool bRendering = false;
|
||||
bool m_bRendering = false;
|
||||
|
||||
std::unordered_map<int, bool> mEntities = {};
|
||||
std::unordered_map<int, bool> m_mEntities = {};
|
||||
};
|
||||
|
||||
ADD_FEATURE(CChams, Chams)
|
||||
@@ -66,7 +66,7 @@ void CESP::StorePlayers(CTFPlayer* pLocal)
|
||||
if (!(Vars::ESP::Player.Value & Vars::ESP::PlayerEnum::Prioritized && F::PlayerUtils.IsPrioritized(iIndex))
|
||||
&& !(Vars::ESP::Player.Value & Vars::ESP::PlayerEnum::Friends && H::Entities.IsFriend(iIndex))
|
||||
&& !(Vars::ESP::Player.Value & Vars::ESP::PlayerEnum::Party && H::Entities.InParty(iIndex))
|
||||
&& pPlayer->m_iTeamNum() == pLocal->m_iTeamNum() ? !(Vars::ESP::Player.Value & Vars::ESP::PlayerEnum::Team) : !(Vars::ESP::Player.Value & Vars::ESP::PlayerEnum::Enemy))
|
||||
&& !(pPlayer->m_iTeamNum() != pLocal->m_iTeamNum() ? Vars::ESP::Player.Value & Vars::ESP::PlayerEnum::Enemy : Vars::ESP::Player.Value & Vars::ESP::PlayerEnum::Team))
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ void CESP::StorePlayers(CTFPlayer* pLocal)
|
||||
if (Vars::ESP::Player.Value & Vars::ESP::PlayerEnum::Priority)
|
||||
{
|
||||
if (auto pTag = F::PlayerUtils.GetSignificantTag(pi.friendsID, 1)) // 50 alpha as white outline tends to be more apparent
|
||||
tCache.m_vText.emplace_back(ESPTextEnum::Top, pTag->Name, pTag->Color, H::Draw.IsColorDark(pTag->Color) ? Color_t(255, 255, 255, 50) : Color_t(0, 0, 0));
|
||||
tCache.m_vText.emplace_back(ESPTextEnum::Top, pTag->m_sName, pTag->m_tColor, H::Draw.IsColorDark(pTag->m_tColor) ? Color_t(255, 255, 255, 50) : Color_t(0, 0, 0));
|
||||
}
|
||||
|
||||
if (Vars::ESP::Player.Value & Vars::ESP::PlayerEnum::Labels)
|
||||
@@ -103,25 +103,25 @@ void CESP::StorePlayers(CTFPlayer* pLocal)
|
||||
for (auto& iID : F::PlayerUtils.m_mPlayerTags[pi.friendsID])
|
||||
{
|
||||
auto pTag = F::PlayerUtils.GetTag(iID);
|
||||
if (pTag && pTag->Label)
|
||||
if (pTag && pTag->m_bLabel)
|
||||
vTags.push_back(pTag);
|
||||
}
|
||||
if (H::Entities.IsFriend(pi.friendsID))
|
||||
{
|
||||
auto pTag = &F::PlayerUtils.m_vTags[F::PlayerUtils.TagToIndex(FRIEND_TAG)];
|
||||
if (pTag->Label)
|
||||
if (pTag->m_bLabel)
|
||||
vTags.push_back(pTag);
|
||||
}
|
||||
if (H::Entities.InParty(pi.friendsID))
|
||||
{
|
||||
auto pTag = &F::PlayerUtils.m_vTags[F::PlayerUtils.TagToIndex(PARTY_TAG)];
|
||||
if (pTag->Label)
|
||||
if (pTag->m_bLabel)
|
||||
vTags.push_back(pTag);
|
||||
}
|
||||
if (H::Entities.IsF2P(pi.friendsID))
|
||||
{
|
||||
auto pTag = &F::PlayerUtils.m_vTags[F::PlayerUtils.TagToIndex(F2P_TAG)];
|
||||
if (pTag->Label)
|
||||
if (pTag->m_bLabel)
|
||||
vTags.push_back(pTag);
|
||||
}
|
||||
|
||||
@@ -130,14 +130,14 @@ void CESP::StorePlayers(CTFPlayer* pLocal)
|
||||
std::sort(vTags.begin(), vTags.end(), [&](const auto a, const auto b) -> bool
|
||||
{
|
||||
// sort by priority if unequal
|
||||
if (a->Priority != b->Priority)
|
||||
return a->Priority > b->Priority;
|
||||
if (a->m_iPriority != b->m_iPriority)
|
||||
return a->m_iPriority > b->m_iPriority;
|
||||
|
||||
return a->Name < b->Name;
|
||||
return a->m_sName < b->m_sName;
|
||||
});
|
||||
|
||||
for (auto& pTag : vTags) // 50 alpha as white outline tends to be more apparent
|
||||
tCache.m_vText.emplace_back(ESPTextEnum::Right, pTag->Name, pTag->Color, H::Draw.IsColorDark(pTag->Color) ? Color_t(255, 255, 255, 50) : Color_t(0, 0, 0));
|
||||
tCache.m_vText.emplace_back(ESPTextEnum::Right, pTag->m_sName, pTag->m_tColor, H::Draw.IsColorDark(pTag->m_tColor) ? Color_t(255, 255, 255, 50) : Color_t(0, 0, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -244,6 +244,16 @@ void CESP::StorePlayers(CTFPlayer* pLocal)
|
||||
// Buffs
|
||||
if (Vars::ESP::Player.Value & Vars::ESP::PlayerEnum::Buffs)
|
||||
{
|
||||
if (pPlayer->InCond(TF_COND_INVULNERABLE) ||
|
||||
pPlayer->InCond(TF_COND_INVULNERABLE_HIDE_UNLESS_DAMAGED) ||
|
||||
pPlayer->InCond(TF_COND_INVULNERABLE_USER_BUFF) ||
|
||||
pPlayer->InCond(TF_COND_INVULNERABLE_CARD_EFFECT))
|
||||
tCache.m_vText.emplace_back(ESPTextEnum::Right, "Uber", Vars::Colors::IndicatorTextBad.Value, Vars::Menu::Theme::Background.Value);
|
||||
else if (pPlayer->InCond(TF_COND_MEGAHEAL))
|
||||
tCache.m_vText.emplace_back(ESPTextEnum::Right, "Megaheal", Vars::Colors::IndicatorTextBad.Value, Vars::Menu::Theme::Background.Value);
|
||||
else if (pPlayer->InCond(TF_COND_PHASE))
|
||||
tCache.m_vText.emplace_back(ESPTextEnum::Right, "Bonk", Vars::Colors::IndicatorTextMid.Value, Vars::Menu::Theme::Background.Value);
|
||||
|
||||
bool bCrits = false, bMiniCrits = false;
|
||||
if (pPlayer->IsCritBoosted())
|
||||
pWeapon && pWeapon->GetWeaponID() == TF_WEAPON_PARTICLE_CANNON ? bMiniCrits = true : bCrits = true;
|
||||
@@ -257,25 +267,6 @@ void CESP::StorePlayers(CTFPlayer* pLocal)
|
||||
else if (bMiniCrits)
|
||||
tCache.m_vText.emplace_back(ESPTextEnum::Right, "Mini-crits", Vars::Colors::IndicatorTextBad.Value, Vars::Menu::Theme::Background.Value);
|
||||
|
||||
if (pPlayer->InCond(TF_COND_RADIUSHEAL) ||
|
||||
pPlayer->InCond(TF_COND_HEALTH_BUFF) ||
|
||||
pPlayer->InCond(TF_COND_RADIUSHEAL_ON_DAMAGE) ||
|
||||
pPlayer->InCond(TF_COND_MEGAHEAL) ||
|
||||
pPlayer->InCond(TF_COND_HALLOWEEN_QUICK_HEAL) ||
|
||||
pPlayer->InCond(TF_COND_HALLOWEEN_HELL_HEAL) ||
|
||||
pPlayer->InCond(TF_COND_KING_BUFFED))
|
||||
tCache.m_vText.emplace_back(ESPTextEnum::Right, "HP+", Vars::Colors::IndicatorTextGood.Value, Vars::Menu::Theme::Background.Value);
|
||||
else if (pPlayer->InCond(TF_COND_HEALTH_OVERHEALED))
|
||||
tCache.m_vText.emplace_back(ESPTextEnum::Right, "HP", Vars::Colors::IndicatorTextGood.Value, Vars::Menu::Theme::Background.Value);
|
||||
|
||||
if (pPlayer->InCond(TF_COND_INVULNERABLE) ||
|
||||
pPlayer->InCond(TF_COND_INVULNERABLE_HIDE_UNLESS_DAMAGED) ||
|
||||
pPlayer->InCond(TF_COND_INVULNERABLE_USER_BUFF) ||
|
||||
pPlayer->InCond(TF_COND_INVULNERABLE_CARD_EFFECT))
|
||||
tCache.m_vText.emplace_back(ESPTextEnum::Right, "Uber", Vars::Colors::IndicatorTextBad.Value, Vars::Menu::Theme::Background.Value);
|
||||
else if (pPlayer->InCond(TF_COND_PHASE))
|
||||
tCache.m_vText.emplace_back(ESPTextEnum::Right, "Bonk", Vars::Colors::IndicatorTextMid.Value, Vars::Menu::Theme::Background.Value);
|
||||
|
||||
/* vaccinator effects */
|
||||
if (pPlayer->InCond(TF_COND_MEDIGUN_UBER_BULLET_RESIST) || pPlayer->InCond(TF_COND_BULLET_IMMUNE))
|
||||
tCache.m_vText.emplace_back(ESPTextEnum::Right, "Bullet+", Vars::Colors::IndicatorTextBad.Value, Vars::Menu::Theme::Background.Value);
|
||||
@@ -297,9 +288,6 @@ void CESP::StorePlayers(CTFPlayer* pLocal)
|
||||
if (pPlayer->InCond(TF_COND_REGENONDAMAGEBUFF))
|
||||
tCache.m_vText.emplace_back(ESPTextEnum::Right, "Conch", Vars::Colors::IndicatorTextBad.Value, Vars::Menu::Theme::Background.Value);
|
||||
|
||||
//if (pPlayer->InCond(TF_COND_BLASTJUMPING))
|
||||
// tCache.m_vText.emplace_back(ESPTextEnum::Right, "Blastjump", Vars::Colors::IndicatorTextMid.Value, Vars::Menu::Theme::Background.Value);
|
||||
|
||||
if (pPlayer->InCond(TF_COND_RUNE_STRENGTH))
|
||||
tCache.m_vText.emplace_back(ESPTextEnum::Right, "Strength", Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value);
|
||||
if (pPlayer->InCond(TF_COND_RUNE_HASTE))
|
||||
@@ -326,6 +314,19 @@ void CESP::StorePlayers(CTFPlayer* pLocal)
|
||||
tCache.m_vText.emplace_back(ESPTextEnum::Right, "Supernova", Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value);
|
||||
if (pPlayer->InCond(TF_COND_POWERUPMODE_DOMINANT))
|
||||
tCache.m_vText.emplace_back(ESPTextEnum::Right, "Dominant", Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value);
|
||||
|
||||
if (pPlayer->InCond(TF_COND_RADIUSHEAL) ||
|
||||
pPlayer->InCond(TF_COND_HEALTH_BUFF) ||
|
||||
pPlayer->InCond(TF_COND_RADIUSHEAL_ON_DAMAGE) ||
|
||||
pPlayer->InCond(TF_COND_HALLOWEEN_QUICK_HEAL) ||
|
||||
pPlayer->InCond(TF_COND_HALLOWEEN_HELL_HEAL) ||
|
||||
pPlayer->InCond(TF_COND_KING_BUFFED))
|
||||
tCache.m_vText.emplace_back(ESPTextEnum::Right, "HP+", Vars::Colors::IndicatorTextGood.Value, Vars::Menu::Theme::Background.Value);
|
||||
else if (pPlayer->InCond(TF_COND_HEALTH_OVERHEALED))
|
||||
tCache.m_vText.emplace_back(ESPTextEnum::Right, "HP", Vars::Colors::IndicatorTextGood.Value, Vars::Menu::Theme::Background.Value);
|
||||
|
||||
//if (pPlayer->InCond(TF_COND_BLASTJUMPING))
|
||||
// tCache.m_vText.emplace_back(ESPTextEnum::Right, "Blastjump", Vars::Colors::IndicatorTextMid.Value, Vars::Menu::Theme::Background.Value);
|
||||
}
|
||||
|
||||
// Debuffs
|
||||
@@ -447,11 +448,11 @@ void CESP::StoreBuildings(CTFPlayer* pLocal)
|
||||
if (!(Vars::ESP::Building.Value & Vars::ESP::BuildingEnum::Prioritized && F::PlayerUtils.IsPrioritized(iIndex))
|
||||
&& !(Vars::ESP::Building.Value & Vars::ESP::BuildingEnum::Friends && H::Entities.IsFriend(iIndex))
|
||||
&& !(Vars::ESP::Building.Value & Vars::ESP::BuildingEnum::Party && H::Entities.InParty(iIndex))
|
||||
&& pOwner->m_iTeamNum() == pLocal->m_iTeamNum() ? !(Vars::ESP::Building.Value & Vars::ESP::BuildingEnum::Team) : !(Vars::ESP::Building.Value & Vars::ESP::BuildingEnum::Enemy))
|
||||
&& !(pOwner->m_iTeamNum() != pLocal->m_iTeamNum() ? Vars::ESP::Building.Value & Vars::ESP::BuildingEnum::Enemy : Vars::ESP::Building.Value & Vars::ESP::BuildingEnum::Team))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if (pEntity->m_iTeamNum() == pLocal->m_iTeamNum() ? !(Vars::ESP::Building.Value & Vars::ESP::BuildingEnum::Team) : !(Vars::ESP::Building.Value & Vars::ESP::BuildingEnum::Enemy))
|
||||
else if (!(pEntity->m_iTeamNum() != pLocal->m_iTeamNum() ? Vars::ESP::Building.Value & Vars::ESP::BuildingEnum::Enemy : Vars::ESP::Building.Value & Vars::ESP::BuildingEnum::Team))
|
||||
continue;
|
||||
|
||||
bool bIsMini = pBuilding->m_bMiniBuilding();
|
||||
@@ -601,11 +602,11 @@ void CESP::StoreProjectiles(CTFPlayer* pLocal)
|
||||
if (!(Vars::ESP::Projectile.Value & Vars::ESP::ProjectileEnum::Prioritized && F::PlayerUtils.IsPrioritized(iIndex))
|
||||
&& !(Vars::ESP::Projectile.Value & Vars::ESP::ProjectileEnum::Friends && H::Entities.IsFriend(iIndex))
|
||||
&& !(Vars::ESP::Projectile.Value & Vars::ESP::ProjectileEnum::Party && H::Entities.InParty(iIndex))
|
||||
&& pOwner->m_iTeamNum() == pLocal->m_iTeamNum() ? !(Vars::ESP::Projectile.Value & Vars::ESP::ProjectileEnum::Team) : !(Vars::ESP::Projectile.Value & Vars::ESP::ProjectileEnum::Enemy))
|
||||
&& !(pOwner->m_iTeamNum() != pLocal->m_iTeamNum() ? Vars::ESP::Projectile.Value & Vars::ESP::ProjectileEnum::Enemy : Vars::ESP::Projectile.Value & Vars::ESP::ProjectileEnum::Team))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if (pEntity->m_iTeamNum() == pLocal->m_iTeamNum() ? !(Vars::ESP::Projectile.Value & Vars::ESP::ProjectileEnum::Team) : !(Vars::ESP::Projectile.Value & Vars::ESP::ProjectileEnum::Enemy))
|
||||
else if (!(pEntity->m_iTeamNum() != pLocal->m_iTeamNum() ? Vars::ESP::Projectile.Value & Vars::ESP::ProjectileEnum::Enemy : Vars::ESP::Projectile.Value & Vars::ESP::ProjectileEnum::Team))
|
||||
continue;
|
||||
|
||||
WorldCache& tCache = m_mWorldCache[pEntity];
|
||||
@@ -753,7 +754,7 @@ void CESP::StoreObjective(CTFPlayer* pLocal)
|
||||
|
||||
for (auto pEntity : H::Entities.GetGroup(EGroupType::WORLD_OBJECTIVE))
|
||||
{
|
||||
if (pEntity->m_iTeamNum() == pLocal->m_iTeamNum() ? !(Vars::ESP::Objective.Value & Vars::ESP::ObjectiveEnum::Team) : !(Vars::ESP::Objective.Value & Vars::ESP::ObjectiveEnum::Enemy))
|
||||
if (!(pEntity->m_iTeamNum() != pLocal->m_iTeamNum() ? Vars::ESP::Objective.Value & Vars::ESP::ObjectiveEnum::Enemy : Vars::ESP::Objective.Value & Vars::ESP::ObjectiveEnum::Team))
|
||||
continue;
|
||||
|
||||
WorldCache& tCache = m_mWorldCache[pEntity];
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
void CFakeAngle::Run(CTFPlayer* pLocal)
|
||||
{
|
||||
if (!pLocal || !pLocal->IsAlive() || pLocal->IsAGhost()
|
||||
|| !F::AntiAim.AntiAimOn() && (!Vars::CL_Move::Fakelag::Fakelag.Value || F::Ticks.m_iShiftedTicks == F::Ticks.m_iMaxShift)
|
||||
|| !F::AntiAim.AntiAimOn() && (!Vars::Fakelag::Fakelag.Value || F::Ticks.m_iShiftedTicks == F::Ticks.m_iMaxShift)
|
||||
|| !Vars::Chams::FakeAngle::Enabled.Value && !Vars::Glow::FakeAngle::Enabled.Value)
|
||||
{
|
||||
bBonesSetup = false;
|
||||
|
||||
@@ -51,16 +51,6 @@ bool CGlow::GetGlow(CTFPlayer* pLocal, CBaseEntity* pEntity, Glow_t* pGlow, Colo
|
||||
|
||||
return GetPlayerGlow(pOwner, pEntity, pLocal, pGlow, pColor, Vars::Glow::Enemy::Buildings.Value, Vars::Glow::Team::Buildings.Value);
|
||||
}
|
||||
// ragdoll glow
|
||||
case ETFClassID::CTFRagdoll:
|
||||
case ETFClassID::CRagdollProp:
|
||||
case ETFClassID::CRagdollPropAttached:
|
||||
{
|
||||
auto pOwner = pEntity->As<CTFRagdoll>()->m_hPlayer().Get();
|
||||
if (!pOwner) pOwner = pEntity;
|
||||
|
||||
return GetPlayerGlow(pOwner, pEntity, pLocal, pGlow, pColor, Vars::Glow::Enemy::Ragdolls.Value, Vars::Glow::Team::Ragdolls.Value);
|
||||
}
|
||||
// projectile glow
|
||||
case ETFClassID::CBaseProjectile:
|
||||
case ETFClassID::CBaseGrenade:
|
||||
@@ -123,6 +113,16 @@ bool CGlow::GetGlow(CTFPlayer* pLocal, CBaseEntity* pEntity, Glow_t* pGlow, Colo
|
||||
|
||||
return GetPlayerGlow(pOwner, pEntity, pLocal, pGlow, pColor, Vars::Glow::Enemy::Projectiles.Value, Vars::Glow::Team::Projectiles.Value);
|
||||
}
|
||||
// ragdoll glow
|
||||
case ETFClassID::CTFRagdoll:
|
||||
case ETFClassID::CRagdollProp:
|
||||
case ETFClassID::CRagdollPropAttached:
|
||||
{
|
||||
auto pOwner = pEntity->As<CTFRagdoll>()->m_hPlayer().Get();
|
||||
if (!pOwner) pOwner = pEntity;
|
||||
|
||||
return GetPlayerGlow(pOwner, pEntity, pLocal, pGlow, pColor, Vars::Glow::Enemy::Ragdolls.Value, Vars::Glow::Team::Ragdolls.Value);
|
||||
}
|
||||
// objective glow
|
||||
case ETFClassID::CCaptureFlag:
|
||||
*pGlow = Glow_t(Vars::Glow::World::Stencil.Value, Vars::Glow::World::Blur.Value);
|
||||
@@ -242,7 +242,7 @@ void CGlow::SetupBegin(Glow_t glow, IMatRenderContext* pRenderContext, IMaterial
|
||||
|
||||
StencilBegin(pRenderContext);
|
||||
|
||||
flSavedBlend = I::RenderView->GetBlend();
|
||||
m_flSavedBlend = I::RenderView->GetBlend();
|
||||
I::RenderView->SetBlend(0.f);
|
||||
I::RenderView->SetColorModulation(1.f, 1.f, 1.f);
|
||||
I::ModelRender->ForcedMaterialOverride(m_pMatGlowColor);
|
||||
@@ -294,14 +294,14 @@ void CGlow::SetupEnd(Glow_t glow, IMatRenderContext* pRenderContext, IMaterial*
|
||||
|
||||
StencilEnd(pRenderContext);
|
||||
|
||||
I::RenderView->SetBlend(flSavedBlend);
|
||||
I::RenderView->SetBlend(m_flSavedBlend);
|
||||
I::RenderView->SetColorModulation(1.f, 1.f, 1.f);
|
||||
I::ModelRender->ForcedMaterialOverride(nullptr);
|
||||
}
|
||||
|
||||
void CGlow::DrawModel(CBaseEntity* pEntity, bool bModel)
|
||||
{
|
||||
bRendering = true;
|
||||
m_bRendering = true;
|
||||
|
||||
/*
|
||||
if (pEntity->IsPlayer())
|
||||
@@ -318,14 +318,14 @@ void CGlow::DrawModel(CBaseEntity* pEntity, bool bModel)
|
||||
else*/
|
||||
pEntity->DrawModel(STUDIO_RENDER | STUDIO_NOSHADOWS);
|
||||
|
||||
bRendering = false;
|
||||
m_bRendering = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CGlow::Store(CTFPlayer* pLocal)
|
||||
{
|
||||
mvEntities.clear();
|
||||
m_mEntities.clear();
|
||||
if (!pLocal)
|
||||
return;
|
||||
|
||||
@@ -338,7 +338,7 @@ void CGlow::Store(CTFPlayer* pLocal)
|
||||
Glow_t tGlow = {}; Color_t tColor = {};
|
||||
if (GetGlow(pLocal, pEntity, &tGlow, &tColor)
|
||||
&& SDK::IsOnScreen(pEntity, !H::Entities.IsProjectile(pEntity) /*&& pEntity->GetClassID() != ETFClassID::CTFMedigunShield*/))
|
||||
mvEntities[tGlow].emplace_back(pEntity, tColor);
|
||||
m_mEntities[tGlow].emplace_back(pEntity, tColor);
|
||||
|
||||
if (pEntity->IsPlayer() && !pEntity->IsDormant())
|
||||
{
|
||||
@@ -362,7 +362,7 @@ void CGlow::Store(CTFPlayer* pLocal)
|
||||
if (bShowEnemy && pEntity->m_iTeamNum() != pLocal->m_iTeamNum() || bShowFriendly && pEntity->m_iTeamNum() == pLocal->m_iTeamNum())
|
||||
{
|
||||
tGlow = Glow_t(Vars::Glow::Backtrack::Stencil.Value, Vars::Glow::Backtrack::Blur.Value);
|
||||
mvEntities[tGlow].emplace_back(pEntity, Vars::Colors::Backtrack.Value.a ? Vars::Colors::Backtrack.Value : tColor, true);
|
||||
m_mEntities[tGlow].emplace_back(pEntity, Vars::Colors::Backtrack.Value.a ? Vars::Colors::Backtrack.Value : tColor, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -371,7 +371,7 @@ void CGlow::Store(CTFPlayer* pLocal)
|
||||
if (Vars::Glow::FakeAngle::Enabled.Value && (Vars::Glow::FakeAngle::Stencil.Value || Vars::Glow::FakeAngle::Blur.Value) && pEntity == pLocal && F::FakeAngle.bDrawChams && F::FakeAngle.bBonesSetup)
|
||||
{
|
||||
tGlow = Glow_t(Vars::Glow::FakeAngle::Stencil.Value, Vars::Glow::FakeAngle::Blur.Value);
|
||||
mvEntities[tGlow].emplace_back(pEntity, Vars::Colors::FakeAngle.Value.a ? Vars::Colors::FakeAngle.Value : tColor, true);
|
||||
m_mEntities[tGlow].emplace_back(pEntity, Vars::Colors::FakeAngle.Value.a ? Vars::Colors::FakeAngle.Value : tColor, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -387,14 +387,14 @@ void CGlow::RenderMain()
|
||||
if (!pRenderContext || !m_pMatGlowColor || !m_pMatBlurX || !m_pMatBlurY || !m_pMatHaloAddToScreen)
|
||||
return F::Materials.ReloadMaterials();
|
||||
|
||||
for (auto& [tGlow, vInfo] : mvEntities)
|
||||
for (auto& [tGlow, vInfo] : m_mEntities)
|
||||
{
|
||||
SetupBegin(tGlow, pRenderContext, m_pMatGlowColor, m_pMatBlurY);
|
||||
for (auto& tInfo : vInfo)
|
||||
{
|
||||
bExtra = tInfo.m_bExtra;
|
||||
m_bExtra = tInfo.m_bExtra;
|
||||
DrawModel(tInfo.m_pEntity, true);
|
||||
bExtra = false;
|
||||
m_bExtra = false;
|
||||
}
|
||||
|
||||
SetupMid(pRenderContext, w, h);
|
||||
@@ -402,9 +402,9 @@ void CGlow::RenderMain()
|
||||
{
|
||||
I::RenderView->SetColorModulation(tInfo.m_cColor.r / 255.f, tInfo.m_cColor.g / 255.f, tInfo.m_cColor.b / 255.f);
|
||||
I::RenderView->SetBlend(tInfo.m_cColor.a / 255.f);
|
||||
bExtra = tInfo.m_bExtra;
|
||||
m_bExtra = tInfo.m_bExtra;
|
||||
DrawModel(tInfo.m_pEntity, false);
|
||||
bExtra = false;
|
||||
m_bExtra = false;
|
||||
}
|
||||
|
||||
SetupEnd(tGlow, pRenderContext, m_pMatBlurX, m_pMatBlurY, m_pMatHaloAddToScreen, w, h);
|
||||
@@ -478,7 +478,7 @@ void CGlow::RenderFakeAngle(const DrawModelState_t& pState, const ModelRenderInf
|
||||
}
|
||||
void CGlow::RenderHandler(const DrawModelState_t& pState, const ModelRenderInfo_t& pInfo, matrix3x4* pBoneToWorld)
|
||||
{
|
||||
if (!bExtra)
|
||||
if (!m_bExtra)
|
||||
{
|
||||
static auto ModelRender_DrawModelExecute = U::Hooks.m_mHooks["IVModelRender_DrawModelExecute"];
|
||||
if (ModelRender_DrawModelExecute)
|
||||
|
||||
@@ -47,10 +47,10 @@ class CGlow
|
||||
Color_t m_cColor;
|
||||
bool m_bExtra = false;
|
||||
};
|
||||
std::unordered_map<Glow_t, std::vector<GlowInfo_t>, GlowHasher_t> mvEntities = {};
|
||||
std::unordered_map<Glow_t, std::vector<GlowInfo_t>, GlowHasher_t> m_mEntities = {};
|
||||
|
||||
float flSavedBlend = 1.f;
|
||||
bool bExtra = false;
|
||||
float m_flSavedBlend = 1.f;
|
||||
bool m_bExtra = false;
|
||||
|
||||
public:
|
||||
void Initialize();
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
void RenderViewmodel(void* ecx, int flags);
|
||||
void RenderViewmodel(const DrawModelState_t& pState, const ModelRenderInfo_t& pInfo, matrix3x4* pBoneToWorld);
|
||||
|
||||
bool bRendering = false;
|
||||
bool m_bRendering = false;
|
||||
};
|
||||
|
||||
ADD_FEATURE(CGlow, Glow)
|
||||
@@ -0,0 +1,193 @@
|
||||
#include "Groups.h"
|
||||
|
||||
#include "../../Players/PlayerUtils.h"
|
||||
|
||||
bool CGroups::ShouldTargetTeam(bool bType, Group_t& tGroup, CBaseEntity* pEntity, CTFPlayer* pLocal)
|
||||
{
|
||||
if (!bType)
|
||||
return false;
|
||||
|
||||
if (tGroup.m_iConditions & ConditionsEnum::Relative)
|
||||
{
|
||||
if (pEntity->m_iTeamNum() != pLocal->m_iTeamNum())
|
||||
return tGroup.m_iConditions & ConditionsEnum::Enemy;
|
||||
else
|
||||
return tGroup.m_iConditions & ConditionsEnum::Team;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pEntity->m_iTeamNum() != pLocal->m_iTeamNum()
|
||||
? !(tGroup.m_iConditions & ConditionsEnum::Enemy)
|
||||
: !(tGroup.m_iConditions & ConditionsEnum::Team))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (pEntity->m_iTeamNum())
|
||||
{
|
||||
case TF_TEAM_BLUE:
|
||||
return tGroup.m_iConditions & ConditionsEnum::BLU;
|
||||
case TF_TEAM_RED:
|
||||
return tGroup.m_iConditions & ConditionsEnum::RED;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CGroups::ShouldTargetOwner(bool bType, Group_t& tGroup, CBaseEntity* pOwner, CBaseEntity* pEntity, CTFPlayer* pLocal)
|
||||
{
|
||||
if (!bType)
|
||||
return false;
|
||||
|
||||
if (tGroup.m_iConditions & ConditionsEnum::Local && pOwner == pLocal
|
||||
|| tGroup.m_iConditions & ConditionsEnum::Friends && H::Entities.IsFriend(pOwner->entindex())
|
||||
|| tGroup.m_iConditions & ConditionsEnum::Party && H::Entities.InParty(pOwner->entindex())
|
||||
|| tGroup.m_iConditions & ConditionsEnum::Priority && F::PlayerUtils.IsPrioritized(pOwner->entindex())
|
||||
|| tGroup.m_iConditions & ConditionsEnum::Target && pEntity->entindex() == G::AimTarget.m_iEntIndex)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return ShouldTargetTeam(bType, tGroup, pEntity, pLocal);
|
||||
}
|
||||
|
||||
bool CGroups::ShouldTarget(Group_t& tGroup, CBaseEntity* pEntity, CTFPlayer* pLocal)
|
||||
{
|
||||
switch (pEntity->GetClassID())
|
||||
{
|
||||
// players
|
||||
case ETFClassID::CTFPlayer:
|
||||
return ShouldTargetOwner(tGroup.m_iTargets & TargetsEnum::Players, tGroup, pEntity, pEntity, pLocal);
|
||||
// buildings
|
||||
case ETFClassID::CObjectSentrygun:
|
||||
case ETFClassID::CObjectDispenser:
|
||||
case ETFClassID::CObjectTeleporter:
|
||||
{
|
||||
auto pOwner = pEntity->As<CBaseObject>()->m_hBuilder().Get();
|
||||
if (!pOwner) pOwner = pEntity;
|
||||
|
||||
return ShouldTargetOwner(tGroup.m_iTargets & TargetsEnum::Buildings, tGroup, pOwner, pEntity, pLocal);
|
||||
}
|
||||
// projectiles
|
||||
case ETFClassID::CBaseProjectile:
|
||||
case ETFClassID::CBaseGrenade:
|
||||
case ETFClassID::CTFWeaponBaseGrenadeProj:
|
||||
case ETFClassID::CTFWeaponBaseMerasmusGrenade:
|
||||
case ETFClassID::CTFGrenadePipebombProjectile:
|
||||
case ETFClassID::CTFStunBall:
|
||||
case ETFClassID::CTFBall_Ornament:
|
||||
case ETFClassID::CTFProjectile_Jar:
|
||||
case ETFClassID::CTFProjectile_Cleaver:
|
||||
case ETFClassID::CTFProjectile_JarGas:
|
||||
case ETFClassID::CTFProjectile_JarMilk:
|
||||
case ETFClassID::CTFProjectile_SpellBats:
|
||||
case ETFClassID::CTFProjectile_SpellKartBats:
|
||||
case ETFClassID::CTFProjectile_SpellMeteorShower:
|
||||
case ETFClassID::CTFProjectile_SpellMirv:
|
||||
case ETFClassID::CTFProjectile_SpellPumpkin:
|
||||
case ETFClassID::CTFProjectile_SpellSpawnBoss:
|
||||
case ETFClassID::CTFProjectile_SpellSpawnHorde:
|
||||
case ETFClassID::CTFProjectile_SpellSpawnZombie:
|
||||
case ETFClassID::CTFProjectile_SpellTransposeTeleport:
|
||||
case ETFClassID::CTFProjectile_Throwable:
|
||||
case ETFClassID::CTFProjectile_ThrowableBreadMonster:
|
||||
case ETFClassID::CTFProjectile_ThrowableBrick:
|
||||
case ETFClassID::CTFProjectile_ThrowableRepel:
|
||||
{
|
||||
auto pOwner = pEntity->As<CTFWeaponBaseGrenadeProj>()->m_hThrower().Get();
|
||||
if (!pOwner) pOwner = pEntity;
|
||||
|
||||
return ShouldTargetOwner(tGroup.m_iTargets & TargetsEnum::Projectiles, tGroup, pOwner, pEntity, pLocal);
|
||||
}
|
||||
case ETFClassID::CTFBaseRocket:
|
||||
case ETFClassID::CTFFlameRocket:
|
||||
case ETFClassID::CTFProjectile_Arrow:
|
||||
case ETFClassID::CTFProjectile_GrapplingHook:
|
||||
case ETFClassID::CTFProjectile_HealingBolt:
|
||||
case ETFClassID::CTFProjectile_Rocket:
|
||||
case ETFClassID::CTFProjectile_BallOfFire: // lifetime too short
|
||||
case ETFClassID::CTFProjectile_MechanicalArmOrb:
|
||||
case ETFClassID::CTFProjectile_SentryRocket:
|
||||
case ETFClassID::CTFProjectile_SpellFireball:
|
||||
case ETFClassID::CTFProjectile_SpellLightningOrb:
|
||||
case ETFClassID::CTFProjectile_SpellKartOrb:
|
||||
case ETFClassID::CTFProjectile_EnergyBall:
|
||||
case ETFClassID::CTFProjectile_Flare:
|
||||
{
|
||||
auto pWeapon = pEntity->As<CTFBaseRocket>()->m_hLauncher().Get();
|
||||
auto pOwner = pWeapon ? pWeapon->As<CTFWeaponBase>()->m_hOwner().Get() : pEntity;
|
||||
if (!pOwner) pOwner = pEntity;
|
||||
|
||||
return ShouldTargetOwner(tGroup.m_iTargets & TargetsEnum::Projectiles, tGroup, pOwner, pEntity, pLocal);
|
||||
}
|
||||
case ETFClassID::CTFBaseProjectile:
|
||||
case ETFClassID::CTFProjectile_EnergyRing: // not drawn, shoulddraw check, small anyways
|
||||
//case ETFClassID::CTFProjectile_Syringe: // not drawn
|
||||
{
|
||||
auto pWeapon = pEntity->As<CTFBaseProjectile>()->m_hLauncher().Get();
|
||||
auto pOwner = pWeapon ? pWeapon->As<CTFWeaponBase>()->m_hOwner().Get() : pEntity;
|
||||
if (!pOwner) pOwner = pEntity;
|
||||
|
||||
return ShouldTargetOwner(tGroup.m_iTargets & TargetsEnum::Projectiles, tGroup, pOwner, pEntity, pLocal);
|
||||
}
|
||||
// ragdolls
|
||||
case ETFClassID::CTFRagdoll:
|
||||
case ETFClassID::CRagdollProp:
|
||||
case ETFClassID::CRagdollPropAttached:
|
||||
{
|
||||
auto pOwner = pEntity->As<CTFRagdoll>()->m_hPlayer().Get();
|
||||
if (!pOwner) pOwner = pEntity;
|
||||
|
||||
return ShouldTargetOwner(tGroup.m_iTargets & TargetsEnum::Ragdolls, tGroup, pOwner, pEntity, pLocal);
|
||||
}
|
||||
// objectives
|
||||
case ETFClassID::CCaptureFlag:
|
||||
return ShouldTargetTeam(tGroup.m_iTargets & TargetsEnum::Objective, tGroup, pEntity, pLocal);
|
||||
// npcs
|
||||
case ETFClassID::CEyeballBoss:
|
||||
case ETFClassID::CHeadlessHatman:
|
||||
case ETFClassID::CMerasmus:
|
||||
case ETFClassID::CTFBaseBoss:
|
||||
case ETFClassID::CTFTankBoss:
|
||||
case ETFClassID::CZombie:
|
||||
if (pEntity->m_iTeamNum() == TF_TEAM_BLUE || pEntity->m_iTeamNum() == TF_TEAM_RED)
|
||||
{
|
||||
if (auto pOwner = pEntity->m_hOwnerEntity().Get())
|
||||
return ShouldTargetOwner(tGroup.m_iTargets & TargetsEnum::NPCs, tGroup, pOwner, pEntity, pLocal);
|
||||
return ShouldTargetTeam(tGroup.m_iTargets & TargetsEnum::NPCs, tGroup, pEntity, pLocal);
|
||||
}
|
||||
return tGroup.m_iTargets & TargetsEnum::NPCs;
|
||||
// pickups
|
||||
case ETFClassID::CBaseAnimating:
|
||||
{
|
||||
if (H::Entities.IsHealth(H::Entities.GetModel(pEntity->entindex())))
|
||||
return tGroup.m_iTargets & TargetsEnum::Health;
|
||||
else if (H::Entities.IsAmmo(H::Entities.GetModel(pEntity->entindex())))
|
||||
return tGroup.m_iTargets & TargetsEnum::Ammo;
|
||||
else if (H::Entities.IsPowerup(H::Entities.GetModel(pEntity->entindex())))
|
||||
return tGroup.m_iTargets & TargetsEnum::Powerups;
|
||||
else if (H::Entities.IsSpellbook(H::Entities.GetModel(pEntity->entindex())))
|
||||
return tGroup.m_iTargets & TargetsEnum::Spellbook;
|
||||
break;
|
||||
}
|
||||
case ETFClassID::CTFAmmoPack:
|
||||
return tGroup.m_iTargets & TargetsEnum::Ammo;
|
||||
case ETFClassID::CCurrencyPack:
|
||||
return tGroup.m_iTargets & TargetsEnum::Money;
|
||||
case ETFClassID::CHalloweenGiftPickup:
|
||||
return tGroup.m_iTargets & TargetsEnum::Gargoyle;
|
||||
// bombs
|
||||
case ETFClassID::CTFPumpkinBomb:
|
||||
case ETFClassID::CTFGenericBomb:
|
||||
return tGroup.m_iTargets & TargetsEnum::Bombs;
|
||||
case ETFClassID::CTFMedigunShield:
|
||||
return false;
|
||||
}
|
||||
|
||||
// players
|
||||
auto pOwner = pEntity->m_hOwnerEntity().Get();
|
||||
if (pOwner && pOwner->IsPlayer())
|
||||
return ShouldTargetOwner(tGroup.m_iTargets & TargetsEnum::Players, tGroup, pOwner, pOwner, pLocal);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
#pragma once
|
||||
#include "../../../SDK/SDK.h"
|
||||
|
||||
Enum(Targets, Players = 1 << 0, Buildings = 1 << 1, Projectiles = 1 << 2, Ragdolls = 1 << 3, Objective = 1 << 4, NPCs = 1 << 5, Health = 1 << 6, Ammo = 1 << 7, Money = 1 << 8, Powerups = 1 << 9, Bombs = 1 << 10, Spellbook = 1 << 11, Gargoyle = 1 << 12)
|
||||
Enum(Conditions, Relative = 1 << 0, Enemy = 1 << 1, Team = 1 << 2, BLU = 1 << 3, RED = 1 << 4, Local = 1 << 5, Friends = 1 << 6, Party = 1 << 7, Priority = 1 << 8, Target = 1 << 9, Scout = 1 << 10, Soldier = 1 << 11, Pyro = 1 << 12, Demoman = 1 << 13, Heavy = 1 << 14, Engineer = 1 << 15, Medic = 1 << 16, Sniper = 1 << 17, Spy = 1 << 18)
|
||||
Enum(ESP, Name = 1 << 0, Box = 1 << 1, Distance = 1 << 2, Bones = 1 << 3, HealthBar = 1 << 4, HealthText = 1 << 5, UberBar = 1 << 6, UberText = 1 << 7, ClassIcon = 1 << 8, ClassText = 1 << 9, WeaponIcon = 1 << 10, WeaponText = 1 << 11, Priority = 1 << 12, Labels = 1 << 13, Buffs = 1 << 14, Debuffs = 1 << 15, Misc = 1 << 16, Lag = 1 << 17, Ping = 1 << 18, KDR = 1 << 19, Owner = 1 << 20, Flags = 1 << 21, Level = 1 << 22, IntelReturnTime = 1 << 23)
|
||||
Enum(Backtrack, Last = 1 << 0, First = 1 << 1, Always = 1 << 2, IgnoreTeam = 1 << 3)
|
||||
|
||||
struct Group_t
|
||||
{
|
||||
std::string m_sName = "";
|
||||
int m_iTargets = 0b0; // ragdolls don't draw esp
|
||||
int m_iConditions = 0b11001; // red/blu only apply if not relative, classes only apply if at least 1 is selected
|
||||
|
||||
int m_iESP = 0b0;
|
||||
|
||||
bool m_bOutOfFOVArrows = false;
|
||||
int m_iOutOfFOVArrowsOffset = 100;
|
||||
float m_flOutOfFOVArrowsMaxDistance = 1000.f;
|
||||
|
||||
int m_iActiveAlpha = 255;
|
||||
int m_iDormantAlpha = 100;
|
||||
float m_flDormantDuration = 1.f;
|
||||
|
||||
bool m_bChams = false;
|
||||
Chams_t m_tChams = {};
|
||||
|
||||
bool m_bGlow = false;
|
||||
Glow_t m_tGlow = {};
|
||||
|
||||
// keep backtrack separate?
|
||||
bool m_bBacktrack = false;
|
||||
int m_iBacktrackDraw = 0b0;
|
||||
Chams_t m_tBacktrackChams = {};
|
||||
bool m_bBacktrackIgnoreZ = false;
|
||||
Glow_t m_tBacktrackGlow = {};
|
||||
};
|
||||
|
||||
class CGroups
|
||||
{
|
||||
private:
|
||||
bool ShouldTarget(Group_t& tGroup, CBaseEntity* pEntity, CTFPlayer* pLocal);
|
||||
bool ShouldTargetOwner(bool bType, Group_t& tGroup, CBaseEntity* pOwner, CBaseEntity* pEntity, CTFPlayer* pLocal);
|
||||
bool ShouldTargetTeam(bool bType, Group_t& tGroup, CBaseEntity* pEntity, CTFPlayer* pLocal);
|
||||
|
||||
public:
|
||||
// GetESP
|
||||
// GetChams
|
||||
// GetGlow
|
||||
// GetBacktrackChams?
|
||||
// GetBacktrackGlow?
|
||||
|
||||
std::vector<Group_t> m_vGroups = {}; // loop through this in reverse so back groups have higher priority
|
||||
};
|
||||
|
||||
ADD_FEATURE(CGroups, Groups)
|
||||
@@ -348,8 +348,8 @@ void CMaterials::RemoveMaterial(const char* sName)
|
||||
removeFromVar(Vars::Chams::World::Occluded);
|
||||
removeFromVar(Vars::Chams::Backtrack::Visible);
|
||||
removeFromVar(Vars::Chams::FakeAngle::Visible);
|
||||
removeFromVar(Vars::Chams::Viewmodel::WeaponVisible);
|
||||
removeFromVar(Vars::Chams::Viewmodel::HandsVisible);
|
||||
removeFromVar(Vars::Chams::Viewmodel::WeaponMaterial);
|
||||
removeFromVar(Vars::Chams::Viewmodel::HandsMaterial);
|
||||
}
|
||||
|
||||
m_bLoaded = true;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "Notifications.h"
|
||||
|
||||
static float EaseInOutCubic(float x)
|
||||
static inline float EaseInOutCubic(float x)
|
||||
{
|
||||
return x < 0.5f ? 4.f * x * x * x : 1 - powf(-2.f * x + 2.f, 3.f) / 2.f;
|
||||
return x < 0.5f ? 4 * powf(x, 3) : 1 - powf(-2 * x + 2, 3) / 2;
|
||||
}
|
||||
|
||||
void CNotifications::Add(const std::string& sText, float flLifeTime, float flPanTime, const Color_t& tAccent, const Color_t& tBackground, const Color_t& tActive)
|
||||
@@ -12,6 +12,34 @@ void CNotifications::Add(const std::string& sText, float flLifeTime, float flPan
|
||||
m_vNotifications.pop_front();
|
||||
}
|
||||
|
||||
static inline bool ShouldReverseX()
|
||||
{
|
||||
switch (Vars::Logging::NotificationPosition.Value)
|
||||
{
|
||||
case Vars::Logging::NotificationPositionEnum::TopLeft:
|
||||
case Vars::Logging::NotificationPositionEnum::BottomLeft:
|
||||
return false;
|
||||
case Vars::Logging::NotificationPositionEnum::TopRight:
|
||||
case Vars::Logging::NotificationPositionEnum::BottomRight:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool ShouldReverseY()
|
||||
{
|
||||
switch (Vars::Logging::NotificationPosition.Value)
|
||||
{
|
||||
case Vars::Logging::NotificationPositionEnum::TopLeft:
|
||||
case Vars::Logging::NotificationPositionEnum::TopRight:
|
||||
return false;
|
||||
case Vars::Logging::NotificationPositionEnum::BottomLeft:
|
||||
case Vars::Logging::NotificationPositionEnum::BottomRight:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void CNotifications::Draw()
|
||||
{
|
||||
for (auto it = m_vNotifications.begin(); it != m_vNotifications.end();)
|
||||
@@ -21,37 +49,40 @@ void CNotifications::Draw()
|
||||
else
|
||||
++it;
|
||||
}
|
||||
|
||||
if (m_vNotifications.empty())
|
||||
return;
|
||||
|
||||
int y = 8;
|
||||
const auto& fFont = H::Fonts.GetFont(FONT_INDICATORS);
|
||||
|
||||
int y = !ShouldReverseY() ? H::Draw.Scale(8, Scale_Round) : H::Draw.m_nScreenH - H::Draw.Scale(8, Scale_Round) - H::Draw.Scale(32, Scale_Round);
|
||||
for (auto& tNotification : m_vNotifications)
|
||||
{
|
||||
int x = 8;
|
||||
Vec2 vSize = H::Draw.GetTextSize(tNotification.m_sText.c_str(), fFont);
|
||||
vSize.x += H::Draw.Scale(23, Scale_Round); vSize.y = H::Draw.Scale(32, Scale_Round);
|
||||
Vec2 vSize = { H::Draw.GetTextSize(tNotification.m_sText.c_str(), fFont).x + H::Draw.Scale(23, Scale_Round), H::Draw.Scale(32, Scale_Round) };
|
||||
|
||||
int x = !ShouldReverseX() ? H::Draw.Scale(8, Scale_Round) : H::Draw.m_nScreenW - H::Draw.Scale(8, Scale_Round) - vSize.x;
|
||||
|
||||
float flTime = SDK::PlatFloatTime();
|
||||
float flCreate = tNotification.m_flCreateTime;
|
||||
float flEase = 0.f;
|
||||
if (float flPan = tNotification.m_flPanTime)
|
||||
{
|
||||
float flTime = SDK::PlatFloatTime();
|
||||
float flCreate = tNotification.m_flCreateTime;
|
||||
float flLife = std::min(flTime - flCreate, flCreate + tNotification.m_flLifeTime - flTime);
|
||||
if (flLife < flPan)
|
||||
{
|
||||
float flRatio = Math::RemapVal(flLife, flPan, 0.f, 0.f, 1.f);
|
||||
flEase = EaseInOutCubic(flRatio);
|
||||
x -= (vSize.x + 8) * flEase;
|
||||
x -= (vSize.x + H::Draw.Scale(8, Scale_Round)) * flEase * (!ShouldReverseX() ? 1 : -1);
|
||||
}
|
||||
}
|
||||
|
||||
float flLife = Math::RemapVal(flCreate + tNotification.m_flLifeTime - flTime, 0.f, tNotification.m_flLifeTime, 0.f, 1.f);
|
||||
H::Draw.GradientRect(x + 1, y + 1, vSize.x - 2, vSize.y - 2, tNotification.m_tBackground.Alpha(255), tNotification.m_tBackground.Alpha(127), true);
|
||||
H::Draw.FillRect(x + 1, y + 1, H::Draw.Scale(2, Scale_Round), vSize.y - 2, tNotification.m_tAccent.Alpha(255));
|
||||
H::Draw.FillRect(x + 1, y + 1, H::Draw.Scale(2, Scale_Round), vSize.y - 2, tNotification.m_tAccent.Alpha(127));
|
||||
H::Draw.FillRect(x + 1, y + 1, H::Draw.Scale(2, Scale_Round), (vSize.y - 2) * flLife, tNotification.m_tAccent.Alpha(255));
|
||||
//H::Draw.LineRoundRect(x, y, vSize.x, vSize.y, 2, tNotification.m_tBackground.Alpha(255), 8);
|
||||
H::Draw.LineRect(x, y, vSize.x, vSize.y, tNotification.m_tBackground.Alpha(255));
|
||||
H::Draw.StringOutlined(fFont, x + H::Draw.Scale(13, Scale_Round), y + H::Draw.Scale(9, Scale_Round), tNotification.m_tActive.Alpha(255), Vars::Menu::Theme::Background.Value, ALIGN_TOPLEFT, tNotification.m_sText.c_str());
|
||||
|
||||
y += (vSize.y + 8) * (1.f - flEase);
|
||||
y += (vSize.y + H::Draw.Scale(8, Scale_Round)) * (1.f - flEase) * (!ShouldReverseY() ? 1 : -1);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
void CPlayerArrows::DrawArrowTo(const Vec3& vFromPos, const Vec3& vToPos, Color_t tColor)
|
||||
{
|
||||
const float flMap = Math::RemapVal(vFromPos.DistTo(vToPos), Vars::Visuals::FOVArrows::MaxDist.Value, Vars::Visuals::FOVArrows::MaxDist.Value * 0.9f, 0.f, 1.f);
|
||||
float flMaxDistance = Vars::ESP::FOVArrows::MaxDistance.Value;
|
||||
float flMap = Math::RemapVal(vFromPos.DistTo(vToPos), flMaxDistance, flMaxDistance * 0.9f, 0.f, 1.f);
|
||||
tColor.a = byte(flMap * 255.f);
|
||||
if (!tColor.a)
|
||||
return;
|
||||
@@ -24,7 +25,7 @@ void CPlayerArrows::DrawArrowTo(const Vec3& vFromPos, const Vec3& vToPos, Color_
|
||||
const float flCos = cos(flDeg);
|
||||
const float flSin = sin(flDeg);
|
||||
|
||||
float flOffset = -Vars::Visuals::FOVArrows::Offset.Value;
|
||||
float flOffset = -Vars::ESP::FOVArrows::Offset.Value;
|
||||
float flScale = H::Draw.Scale(25);
|
||||
Vec2 v1 = { flOffset, flScale / 2 },
|
||||
v2 = { flOffset, -flScale / 2 },
|
||||
@@ -40,7 +41,7 @@ void CPlayerArrows::DrawArrowTo(const Vec3& vFromPos, const Vec3& vToPos, Color_
|
||||
|
||||
void CPlayerArrows::Run(CTFPlayer* pLocal)
|
||||
{
|
||||
if (!Vars::Visuals::FOVArrows::Enabled.Value)
|
||||
if (!Vars::ESP::FOVArrows::Enabled.Value)
|
||||
return;
|
||||
|
||||
const Vec3 vLocalPos = pLocal->GetEyePosition();
|
||||
|
||||
@@ -19,7 +19,7 @@ bool CRadar::GetDrawPosition(CTFPlayer* pLocal, CBaseEntity* pEntity, int& x, in
|
||||
const float flDist = vDelta.Length2D();
|
||||
if (flDist > flRange)
|
||||
{
|
||||
if (!Vars::Radar::Main::AlwaysDraw.Value)
|
||||
if (!Vars::Radar::Main::DrawOutOfRange.Value)
|
||||
return false;
|
||||
|
||||
vPos *= flRange / flDist;
|
||||
@@ -29,7 +29,7 @@ bool CRadar::GetDrawPosition(CTFPlayer* pLocal, CBaseEntity* pEntity, int& x, in
|
||||
case Vars::Radar::Main::StyleEnum::Rectangle:
|
||||
if (fabs(vPos.x) > flRange || fabs(vPos.y) > flRange)
|
||||
{
|
||||
if (!Vars::Radar::Main::AlwaysDraw.Value)
|
||||
if (!Vars::Radar::Main::DrawOutOfRange.Value)
|
||||
return false;
|
||||
|
||||
Vec2 a = { -flRange / vPos.x, -flRange / vPos.y };
|
||||
@@ -52,7 +52,7 @@ void CRadar::DrawBackground()
|
||||
auto& tWindowBox = Vars::Radar::Main::Window.Value;
|
||||
Color_t& tThemeBack = Vars::Menu::Theme::Background.Value;
|
||||
Color_t& tThemeAccent = Vars::Menu::Theme::Accent.Value;
|
||||
Color_t tColorBackground = { tThemeBack.r, tThemeBack.g, tThemeBack.b, byte(Vars::Radar::Main::BackAlpha.Value) };
|
||||
Color_t tColorBackground = { tThemeBack.r, tThemeBack.g, tThemeBack.b, byte(Vars::Radar::Main::BackgroundAlpha.Value) };
|
||||
Color_t tColorAccent = { tThemeAccent.r, tThemeAccent.g, tThemeAccent.b, byte(Vars::Radar::Main::LineAlpha.Value) };
|
||||
|
||||
switch (Vars::Radar::Main::Style.Value)
|
||||
@@ -78,7 +78,7 @@ void CRadar::DrawPoints(CTFPlayer* pLocal)
|
||||
// Ammo & Health
|
||||
if (Vars::Radar::World::Enabled.Value)
|
||||
{
|
||||
const int iSize = Vars::Radar::World::IconSize.Value;
|
||||
const int iSize = Vars::Radar::World::Size.Value;
|
||||
|
||||
if (Vars::Radar::World::Draw.Value & Vars::Radar::World::DrawEnum::Gargoyle)
|
||||
{
|
||||
@@ -208,9 +208,9 @@ void CRadar::DrawPoints(CTFPlayer* pLocal)
|
||||
}
|
||||
|
||||
// Draw buildings
|
||||
if (Vars::Radar::Buildings::Enabled.Value)
|
||||
if (Vars::Radar::Building::Enabled.Value)
|
||||
{
|
||||
const int iSize = Vars::Radar::Buildings::IconSize.Value;
|
||||
const int iSize = Vars::Radar::Building::Size.Value;
|
||||
|
||||
for (auto pEntity : H::Entities.GetGroup(EGroupType::BUILDINGS_ALL))
|
||||
{
|
||||
@@ -224,15 +224,15 @@ void CRadar::DrawPoints(CTFPlayer* pLocal)
|
||||
const int nIndex = pOwner->entindex();
|
||||
if (pLocal->m_iObserverMode() == OBS_MODE_FIRSTPERSON ? pLocal->m_hObserverTarget().Get() == pOwner : nIndex == I::EngineClient->GetLocalPlayer())
|
||||
{
|
||||
if (!(Vars::Radar::Buildings::Draw.Value & Vars::Radar::Buildings::DrawEnum::Local))
|
||||
if (!(Vars::Radar::Building::Draw.Value & Vars::Radar::Building::DrawEnum::Local))
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(Vars::Radar::Buildings::Draw.Value & Vars::Radar::Buildings::DrawEnum::Prioritized && F::PlayerUtils.IsPrioritized(nIndex))
|
||||
&& !(Vars::Radar::Buildings::Draw.Value & Vars::Radar::Buildings::DrawEnum::Friends && H::Entities.IsFriend(nIndex))
|
||||
&& !(Vars::Radar::Buildings::Draw.Value & Vars::Radar::Buildings::DrawEnum::Party && H::Entities.InParty(nIndex))
|
||||
&& pOwner->As<CTFPlayer>()->m_iTeamNum() == pLocal->m_iTeamNum() ? !(Vars::Radar::Buildings::Draw.Value & Vars::Radar::Buildings::DrawEnum::Team) : !(Vars::Radar::Buildings::Draw.Value & Vars::Radar::Buildings::DrawEnum::Enemy))
|
||||
if (!(Vars::Radar::Building::Draw.Value & Vars::Radar::Building::DrawEnum::Prioritized && F::PlayerUtils.IsPrioritized(nIndex))
|
||||
&& !(Vars::Radar::Building::Draw.Value & Vars::Radar::Building::DrawEnum::Friends && H::Entities.IsFriend(nIndex))
|
||||
&& !(Vars::Radar::Building::Draw.Value & Vars::Radar::Building::DrawEnum::Party && H::Entities.InParty(nIndex))
|
||||
&& !(pOwner->As<CTFPlayer>()->m_iTeamNum() != pLocal->m_iTeamNum() ? Vars::Radar::Building::Draw.Value & Vars::Radar::Building::DrawEnum::Enemy : Vars::Radar::Building::Draw.Value & Vars::Radar::Building::DrawEnum::Team))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -244,7 +244,7 @@ void CRadar::DrawPoints(CTFPlayer* pLocal)
|
||||
const Color_t tColor = H::Color.GetEntityDrawColor(pLocal, pBuilding, Vars::Colors::Relative.Value);
|
||||
|
||||
int iBounds = iSize;
|
||||
if (Vars::Radar::Buildings::Background.Value)
|
||||
if (Vars::Radar::Building::Background.Value)
|
||||
{
|
||||
const float flRadius = sqrtf(pow(iSize, 2) * 2) / 2;
|
||||
H::Draw.FillCircle(x, y, flRadius, 20, tColor);
|
||||
@@ -264,7 +264,7 @@ void CRadar::DrawPoints(CTFPlayer* pLocal)
|
||||
break;
|
||||
}
|
||||
|
||||
if (Vars::Radar::Buildings::Health.Value)
|
||||
if (Vars::Radar::Building::Health.Value)
|
||||
{
|
||||
const int iMaxHealth = pBuilding->m_iMaxHealth(), iHealth = pBuilding->m_iHealth();
|
||||
|
||||
@@ -277,9 +277,9 @@ void CRadar::DrawPoints(CTFPlayer* pLocal)
|
||||
}
|
||||
|
||||
// Draw Players
|
||||
if (Vars::Radar::Players::Enabled.Value)
|
||||
if (Vars::Radar::Player::Enabled.Value)
|
||||
{
|
||||
const int iSize = Vars::Radar::Players::IconSize.Value;
|
||||
const int iSize = Vars::Radar::Player::Size.Value;
|
||||
|
||||
for (auto pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_ALL))
|
||||
{
|
||||
@@ -290,18 +290,18 @@ void CRadar::DrawPoints(CTFPlayer* pLocal)
|
||||
const int nIndex = pPlayer->entindex();
|
||||
if (pLocal->m_iObserverMode() == OBS_MODE_FIRSTPERSON ? pLocal->m_hObserverTarget().Get() == pPlayer : nIndex == I::EngineClient->GetLocalPlayer())
|
||||
{
|
||||
if (!(Vars::Radar::Players::Draw.Value & Vars::Radar::Players::DrawEnum::Local))
|
||||
if (!(Vars::Radar::Player::Draw.Value & Vars::Radar::Player::DrawEnum::Local))
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(Vars::Radar::Players::Draw.Value & Vars::Radar::Players::DrawEnum::Prioritized && F::PlayerUtils.IsPrioritized(nIndex))
|
||||
&& !(Vars::Radar::Players::Draw.Value & Vars::Radar::Players::DrawEnum::Friends && H::Entities.IsFriend(nIndex))
|
||||
&& !(Vars::Radar::Players::Draw.Value & Vars::Radar::Players::DrawEnum::Party && H::Entities.InParty(nIndex))
|
||||
&& pPlayer->m_iTeamNum() == pLocal->m_iTeamNum() ? !(Vars::Radar::Players::Draw.Value & Vars::Radar::Players::DrawEnum::Team) : !(Vars::Radar::Players::Draw.Value & Vars::Radar::Players::DrawEnum::Enemy))
|
||||
if (!(Vars::Radar::Player::Draw.Value & Vars::Radar::Player::DrawEnum::Prioritized && F::PlayerUtils.IsPrioritized(nIndex))
|
||||
&& !(Vars::Radar::Player::Draw.Value & Vars::Radar::Player::DrawEnum::Friends && H::Entities.IsFriend(nIndex))
|
||||
&& !(Vars::Radar::Player::Draw.Value & Vars::Radar::Player::DrawEnum::Party && H::Entities.InParty(nIndex))
|
||||
&& !(pPlayer->m_iTeamNum() != pLocal->m_iTeamNum() ? Vars::Radar::Player::Draw.Value & Vars::Radar::Player::DrawEnum::Enemy : Vars::Radar::Player::Draw.Value & Vars::Radar::Player::DrawEnum::Team))
|
||||
continue;
|
||||
}
|
||||
if (!(Vars::Radar::Players::Draw.Value & Vars::Radar::Players::DrawEnum::Cloaked) && pPlayer->m_flInvisibility() >= 1.f)
|
||||
if (!(Vars::Radar::Player::Draw.Value & Vars::Radar::Player::DrawEnum::Cloaked) && pPlayer->m_flInvisibility() >= 1.f)
|
||||
continue;
|
||||
|
||||
int x, y, z;
|
||||
@@ -310,16 +310,16 @@ void CRadar::DrawPoints(CTFPlayer* pLocal)
|
||||
const Color_t tColor = H::Color.GetEntityDrawColor(pLocal, pPlayer, Vars::Colors::Relative.Value);
|
||||
|
||||
int iBounds = iSize;
|
||||
if (Vars::Radar::Players::Background.Value)
|
||||
if (Vars::Radar::Player::Background.Value)
|
||||
{
|
||||
const float flRadius = sqrtf(pow(iSize, 2) * 2) / 2;
|
||||
H::Draw.FillCircle(x, y, flRadius, 20, tColor);
|
||||
iBounds = flRadius * 2;
|
||||
}
|
||||
|
||||
switch (Vars::Radar::Players::IconType.Value)
|
||||
switch (Vars::Radar::Player::Icon.Value)
|
||||
{
|
||||
case Vars::Radar::Players::IconTypeEnum::Avatars:
|
||||
case Vars::Radar::Player::IconEnum::Avatars:
|
||||
{
|
||||
PlayerInfo_t pi{};
|
||||
if (I::EngineClient->GetPlayerInfo(pPlayer->entindex(), &pi) && !pi.fakeplayer)
|
||||
@@ -333,19 +333,19 @@ void CRadar::DrawPoints(CTFPlayer* pLocal)
|
||||
}
|
||||
[[fallthrough]];
|
||||
}
|
||||
case Vars::Radar::Players::IconTypeEnum::Portraits:
|
||||
case Vars::Radar::Player::IconEnum::Portraits:
|
||||
if (pPlayer->IsInValidTeam())
|
||||
{
|
||||
H::Draw.Texture(x, y, iSize, iSize, pPlayer->m_iClass() + (pPlayer->m_iTeamNum() == TF_TEAM_RED ? 9 : 18) - 1);
|
||||
break;
|
||||
}
|
||||
[[fallthrough]];
|
||||
case Vars::Radar::Players::IconTypeEnum::Icons:
|
||||
case Vars::Radar::Player::IconEnum::Icons:
|
||||
H::Draw.Texture(x, y, iSize, iSize, pPlayer->m_iClass() - 1);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Vars::Radar::Players::Health.Value)
|
||||
if (Vars::Radar::Player::Health.Value)
|
||||
{
|
||||
const int iMaxHealth = pPlayer->GetMaxHealth(), iHealth = pPlayer->m_iHealth();
|
||||
|
||||
@@ -362,7 +362,7 @@ void CRadar::DrawPoints(CTFPlayer* pLocal)
|
||||
}
|
||||
}
|
||||
|
||||
if (Vars::Radar::Players::Height.Value && std::abs(z) > 80.f)
|
||||
if (Vars::Radar::Player::Height.Value && std::abs(z) > 80.f)
|
||||
{
|
||||
const int m = x - iSize / 2;
|
||||
const int iOffset = z < 0 ? -5 : 5;
|
||||
|
||||
@@ -111,11 +111,11 @@ void CSpectatorList::Draw(CTFPlayer* pLocal)
|
||||
|
||||
Color_t tColor = Vars::Menu::Theme::Active.Value;
|
||||
if (Spectator.m_bIsFriend)
|
||||
tColor = F::PlayerUtils.m_vTags[F::PlayerUtils.TagToIndex(FRIEND_TAG)].Color;
|
||||
tColor = F::PlayerUtils.m_vTags[F::PlayerUtils.TagToIndex(FRIEND_TAG)].m_tColor;
|
||||
else if (Spectator.m_bInParty)
|
||||
tColor = F::PlayerUtils.m_vTags[F::PlayerUtils.TagToIndex(PARTY_TAG)].Color;
|
||||
tColor = F::PlayerUtils.m_vTags[F::PlayerUtils.TagToIndex(PARTY_TAG)].m_tColor;
|
||||
else if (Spectator.m_bRespawnTimeIncreased)
|
||||
tColor = F::PlayerUtils.m_vTags[F::PlayerUtils.TagToIndex(CHEATER_TAG)].Color;
|
||||
tColor = F::PlayerUtils.m_vTags[F::PlayerUtils.TagToIndex(CHEATER_TAG)].m_tColor;
|
||||
else if (FNV1A::Hash32(Spectator.m_sMode.c_str()) == FNV1A::Hash32Const("1st"))
|
||||
tColor = tColor.Lerp({ 255, 150, 0, 255 }, 0.5f);
|
||||
H::Draw.StringOutlined(fFont, x + iconOffset, y, tColor, Vars::Menu::Theme::Background.Value, align, std::format("{} ({} - respawn {}s)", Spectator.m_sName, Spectator.m_sMode, ceilf(Spectator.m_flRespawnIn)).c_str());
|
||||
|
||||
@@ -70,7 +70,7 @@ void CVisuals::DrawTicks(CTFPlayer* pLocal)
|
||||
}
|
||||
}
|
||||
else
|
||||
H::Draw.StringOutlined(fFont, dtPos.x, dtPos.y + 2, Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value, ALIGN_TOP, std::format("Speedhack x{}", Vars::CL_Move::SpeedFactor.Value).c_str());
|
||||
H::Draw.StringOutlined(fFont, dtPos.x, dtPos.y + 2, Vars::Menu::Theme::Active.Value, Vars::Menu::Theme::Background.Value, ALIGN_TOP, std::format("Speedhack x{}", Vars::Speedhack::Factor.Value).c_str());
|
||||
}
|
||||
|
||||
void CVisuals::DrawPing(CTFPlayer* pLocal)
|
||||
@@ -375,7 +375,7 @@ void CVisuals::SplashRadius(CTFPlayer* pLocal)
|
||||
if (!(Vars::Visuals::Simulation::SplashRadius.Value & Vars::Visuals::Simulation::SplashRadiusEnum::Priority && F::PlayerUtils.IsPrioritized(pOwner->entindex()))
|
||||
&& !(Vars::Visuals::Simulation::SplashRadius.Value & Vars::Visuals::Simulation::SplashRadiusEnum::Friends && H::Entities.IsFriend(pOwner->entindex()))
|
||||
&& !(Vars::Visuals::Simulation::SplashRadius.Value & Vars::Visuals::Simulation::SplashRadiusEnum::Party && H::Entities.InParty(pOwner->entindex()))
|
||||
&& pOwner->m_iTeamNum() == pLocal->m_iTeamNum() ? !(Vars::Visuals::Simulation::SplashRadius.Value & Vars::Visuals::Simulation::SplashRadiusEnum::Team) : !(Vars::Visuals::Simulation::SplashRadius.Value & Vars::Visuals::Simulation::SplashRadiusEnum::Enemy))
|
||||
&& !(pOwner->m_iTeamNum() != pLocal->m_iTeamNum() ? Vars::Visuals::Simulation::SplashRadius.Value & Vars::Visuals::Simulation::SplashRadiusEnum::Enemy : Vars::Visuals::Simulation::SplashRadius.Value & Vars::Visuals::Simulation::SplashRadiusEnum::Team))
|
||||
continue;
|
||||
}
|
||||
else if (!(Vars::Visuals::Simulation::SplashRadius.Value & Vars::Visuals::Simulation::SplashRadiusEnum::Local))
|
||||
@@ -432,11 +432,9 @@ void CVisuals::DrawAntiAim(CTFPlayer* pLocal)
|
||||
Vec3 vScreen1, vScreen2;
|
||||
if (SDK::W2S(vOrigin, vScreen1))
|
||||
{
|
||||
constexpr float flDistance = 50.f;
|
||||
if (SDK::W2S(Math::RotatePoint(vOrigin, {}, F::AntiAim.vRealAngles.y).Normalized() * flDistance, vScreen2))
|
||||
if (SDK::W2S(vOrigin + Math::RotatePoint({ 50, 0, 0 }, {}, { 0, F::AntiAim.vRealAngles.y, 0 }), vScreen2))
|
||||
H::Draw.Line(vScreen1.x, vScreen1.y, vScreen2.x, vScreen2.y, { 0, 255, 0, 255 });
|
||||
|
||||
if (SDK::W2S(Math::RotatePoint(vOrigin, {}, F::AntiAim.vFakeAngles.y).Normalized() * flDistance, vScreen2))
|
||||
if (SDK::W2S(vOrigin + Math::RotatePoint({ 50, 0, 0 }, {}, { 0, F::AntiAim.vFakeAngles.y, 0 }), vScreen2))
|
||||
H::Draw.Line(vScreen1.x, vScreen1.y, vScreen2.x, vScreen2.y, { 255, 0, 0, 255 });
|
||||
}
|
||||
|
||||
@@ -687,7 +685,7 @@ void CVisuals::DrawLines()
|
||||
if (tLine.m_flTime < I::GlobalVars->curtime)
|
||||
continue;
|
||||
|
||||
RenderLine(tLine.m_vPair.first, tLine.m_vPair.second, tLine.m_color, tLine.m_bZBuffer);
|
||||
RenderLine(tLine.m_vPair.first, tLine.m_vPair.second, tLine.m_tColor, tLine.m_bZBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -698,7 +696,7 @@ void CVisuals::DrawPaths()
|
||||
if (tPath.m_flTime >= 0.f && tPath.m_flTime < I::GlobalVars->curtime)
|
||||
continue;
|
||||
|
||||
DrawPath(tPath.m_vPath, tPath.m_color, tPath.m_iStyle, tPath.m_bZBuffer, tPath.m_flTime);
|
||||
DrawPath(tPath.m_vPath, tPath.m_tColor, tPath.m_iStyle, tPath.m_bZBuffer, tPath.m_flTime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -733,7 +731,7 @@ void CVisuals::RestoreBoxes()
|
||||
|
||||
void CVisuals::DrawServerHitboxes(CTFPlayer* pLocal)
|
||||
{
|
||||
if (!Vars::Debug::ServerHitbox.Value)
|
||||
if (!Vars::Debug::DrawServerHitboxes.Value)
|
||||
return;
|
||||
|
||||
if (I::Input->CAM_IsThirdPerson() && pLocal->IsAlive())
|
||||
@@ -807,7 +805,7 @@ void CVisuals::ThirdPerson(CTFPlayer* pLocal, CViewSetup* pView)
|
||||
//if (bForce)
|
||||
// return;
|
||||
|
||||
if (Vars::Visuals::ThirdPerson::Enabled.Value && !bZoom || bForce)
|
||||
if (Vars::Visuals::Thirdperson::Enabled.Value && !bZoom || bForce)
|
||||
I::Input->CAM_ToThirdPerson();
|
||||
else
|
||||
I::Input->CAM_ToFirstPerson();
|
||||
@@ -821,16 +819,16 @@ void CVisuals::ThirdPerson(CTFPlayer* pLocal, CViewSetup* pView)
|
||||
Vec3 vForward, vRight, vUp; Math::AngleVectors(pView->angles, &vForward, &vRight, &vUp);
|
||||
|
||||
Vec3 vOffset;
|
||||
float flScale = Vars::Visuals::ThirdPerson::Scale.Value ? pLocal->m_flModelScale() : 1.f;
|
||||
vOffset += vRight * Vars::Visuals::ThirdPerson::Right.Value * flScale;
|
||||
vOffset += vUp * Vars::Visuals::ThirdPerson::Up.Value * flScale;
|
||||
vOffset -= vForward * Vars::Visuals::ThirdPerson::Distance.Value * flScale;
|
||||
float flScale = Vars::Visuals::Thirdperson::Scale.Value ? pLocal->m_flModelScale() : 1.f;
|
||||
vOffset += vRight * Vars::Visuals::Thirdperson::Right.Value * flScale;
|
||||
vOffset += vUp * Vars::Visuals::Thirdperson::Up.Value * flScale;
|
||||
vOffset -= vForward * Vars::Visuals::Thirdperson::Distance.Value * flScale;
|
||||
|
||||
Vec3 vOrigin = pLocal->GetEyePosition(); //pView->origin
|
||||
Vec3 vStart = vOrigin;
|
||||
Vec3 vEnd = vOrigin + vOffset;
|
||||
|
||||
if (Vars::Visuals::ThirdPerson::Collide.Value)
|
||||
if (Vars::Visuals::Thirdperson::Collide.Value)
|
||||
{
|
||||
float flHull = 9.f * flScale;
|
||||
Vec3 vMins = { -flHull, -flHull, -flHull }, vMaxs = { flHull, flHull, flHull };
|
||||
@@ -848,7 +846,7 @@ void CVisuals::ThirdPerson(CTFPlayer* pLocal, CViewSetup* pView)
|
||||
void CVisuals::DrawSightlines()
|
||||
{
|
||||
for (auto& tSightline : m_vSightLines)
|
||||
RenderLine(tSightline.m_vStart, tSightline.m_vEnd, tSightline.m_Color);
|
||||
RenderLine(tSightline.m_vStart, tSightline.m_vEnd, tSightline.m_Color, tSightline.m_bZBuffer);
|
||||
}
|
||||
|
||||
void CVisuals::Store(CTFPlayer* pLocal)
|
||||
@@ -857,7 +855,7 @@ void CVisuals::Store(CTFPlayer* pLocal)
|
||||
return;
|
||||
|
||||
m_vSightLines.clear();
|
||||
if (Vars::Visuals::UI::SniperSightlines.Value)
|
||||
if (Vars::ESP::Other::SniperSightlines.Value & ~Vars::ESP::Other::SniperSightlinesEnum::DrawThroughWalls)
|
||||
{
|
||||
std::unordered_map<IClientEntity*, Vec3> mDots = {};
|
||||
for (auto pEntity : H::Entities.GetGroup(EGroupType::MISC_DOTS))
|
||||
@@ -866,16 +864,17 @@ void CVisuals::Store(CTFPlayer* pLocal)
|
||||
mDots[pOwner] = pEntity->m_vecOrigin();
|
||||
}
|
||||
|
||||
for (auto pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_ENEMIES))
|
||||
bool bDrawThroughWalls = Vars::ESP::Other::SniperSightlines.Value & Vars::ESP::Other::SniperSightlinesEnum::DrawThroughWalls;
|
||||
for (auto pEntity : H::Entities.GetGroup(EGroupType::PLAYERS_ALL))
|
||||
{
|
||||
auto pPlayer = pEntity->As<CTFPlayer>();
|
||||
if (pPlayer == pLocal || !(pPlayer->m_iTeamNum() != pLocal->m_iTeamNum() ? Vars::ESP::Other::SniperSightlines.Value & Vars::ESP::Other::SniperSightlinesEnum::Enemy : Vars::ESP::Other::SniperSightlines.Value & Vars::ESP::Other::SniperSightlinesEnum::Team))
|
||||
continue;
|
||||
|
||||
auto pWeapon = pPlayer->m_hActiveWeapon().Get()->As<CTFWeaponBase>();
|
||||
if (pPlayer->IsDormant() || !pPlayer->IsAlive() || pPlayer->IsAGhost() || !pPlayer->InCond(TF_COND_AIMING) ||
|
||||
!pWeapon || pWeapon->GetWeaponID() == TF_WEAPON_COMPOUND_BOW || pWeapon->GetWeaponID() == TF_WEAPON_MINIGUN)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Vec3 vShootPos = pPlayer->m_vecOrigin() + pPlayer->GetViewOffset();
|
||||
Vec3 vForward; Math::AngleVectors(pPlayer->GetEyeAngles(), &vForward);
|
||||
@@ -885,14 +884,14 @@ void CVisuals::Store(CTFPlayer* pLocal)
|
||||
CTraceFilterHitscan filter = {}; filter.pSkip = pPlayer;
|
||||
SDK::Trace(vShootPos, vShootEnd, MASK_SHOT, &filter, &trace);
|
||||
|
||||
m_vSightLines.emplace_back(vShootPos, trace.endpos, H::Color.GetEntityDrawColor(pLocal, pPlayer, Vars::Colors::Relative.Value));
|
||||
m_vSightLines.emplace_back(vShootPos, trace.endpos, H::Color.GetEntityDrawColor(pLocal, pPlayer, Vars::Colors::Relative.Value), !bDrawThroughWalls);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CVisuals::DrawPickupTimers()
|
||||
{
|
||||
if (!Vars::Visuals::UI::PickupTimers.Value)
|
||||
if (!Vars::ESP::Other::PickupTimers.Value)
|
||||
return;
|
||||
|
||||
for (auto it = m_vPickups.begin(); it != m_vPickups.end();)
|
||||
@@ -969,7 +968,7 @@ void CVisuals::Event(IGameEvent* pEvent, uint32_t uHash)
|
||||
}
|
||||
case FNV1A::Hash32Const("item_pickup"):
|
||||
{
|
||||
if (!Vars::Visuals::UI::PickupTimers.Value)
|
||||
if (!Vars::ESP::Other::PickupTimers.Value)
|
||||
return;
|
||||
|
||||
auto pEntity = I::ClientEntityList->GetClientEntity(I::EngineClient->GetPlayerForUserID(pEvent->GetInt("userid")))->As<CTFPlayer>();
|
||||
@@ -1043,7 +1042,7 @@ void CVisuals::OverrideWorldTextures()
|
||||
}
|
||||
}
|
||||
|
||||
static inline void ApplyModulation(const Color_t& clr, bool bSky = false)
|
||||
static inline void ApplyModulation(const Color_t& tColor, bool bSky = false)
|
||||
{
|
||||
for (auto h = I::MaterialSystem->FirstMaterial(); h != I::MaterialSystem->InvalidMaterial(); h = I::MaterialSystem->NextMaterial(h))
|
||||
{
|
||||
@@ -1055,7 +1054,7 @@ static inline void ApplyModulation(const Color_t& clr, bool bSky = false)
|
||||
if (!bSky ? !sGroup._Starts_with("World") : !sGroup._Starts_with("SkyBox"))
|
||||
continue;
|
||||
|
||||
pMaterial->ColorModulate(float(clr.r) / 255.f, float(clr.g) / 255.f, float(clr.b) / 255.f);
|
||||
pMaterial->ColorModulate(tColor.r / 255.f, tColor.g / 255.f, tColor.b / 255.f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1068,26 +1067,26 @@ void CVisuals::Modulate()
|
||||
bool bSetChanged, bColorChanged, bSkyChanged, bConnection;
|
||||
{
|
||||
static bool bStaticWorld = false, bStaticSky = false;
|
||||
bool bOldWorld = bStaticWorld, bOldSky = bStaticSky;
|
||||
bool bNewWorld = bStaticWorld = bWorldModulation, bNewSky = bStaticSky = bSkyModulation;
|
||||
const bool bOldWorld = bStaticWorld, bOldSky = bStaticSky;
|
||||
const bool bNewWorld = bStaticWorld = bWorldModulation, bNewSky = bStaticSky = bSkyModulation;
|
||||
bSetChanged = bNewWorld != bOldWorld || bNewSky != bOldSky;
|
||||
}
|
||||
{
|
||||
static Color_t tStaticWorld = {}, tStaticSky = {};
|
||||
Color_t tOldWorld = tStaticWorld, tOldSky = tStaticSky;
|
||||
Color_t tNewWorld = tStaticWorld = Vars::Colors::WorldModulation.Value, tNewSky = tStaticSky = Vars::Colors::SkyModulation.Value;
|
||||
const Color_t tOldWorld = tStaticWorld, tOldSky = tStaticSky;
|
||||
const Color_t tNewWorld = tStaticWorld = Vars::Colors::WorldModulation.Value, tNewSky = tStaticSky = Vars::Colors::SkyModulation.Value;
|
||||
bColorChanged = tNewWorld != tOldWorld || tNewSky != tOldSky;
|
||||
}
|
||||
{
|
||||
static uint32_t uStatic = 0;
|
||||
uint32_t uOld = uStatic;
|
||||
uint32_t uNew = uStatic = FNV1A::Hash32(Vars::Visuals::World::SkyboxChanger.Value.c_str());
|
||||
const uint32_t uOld = uStatic;
|
||||
const uint32_t uNew = uStatic = FNV1A::Hash32(Vars::Visuals::World::SkyboxChanger.Value.c_str());
|
||||
bSkyChanged = uNew != uOld;
|
||||
}
|
||||
{
|
||||
static bool bStaticConnected = false;
|
||||
bool bOldConnected = bStaticConnected;
|
||||
bool bNewConnected = bStaticConnected = I::EngineClient->IsConnected() && I::EngineClient->IsInGame();
|
||||
const bool bOldConnected = bStaticConnected;
|
||||
const bool bNewConnected = bStaticConnected = I::EngineClient->IsConnected() && I::EngineClient->IsInGame();
|
||||
bConnection = bNewConnected == bOldConnected;
|
||||
}
|
||||
|
||||
@@ -1109,11 +1108,11 @@ void CVisuals::CreateMove(CTFPlayer* pLocal, CTFWeaponBase* pWeapon)
|
||||
if (Vars::Visuals::Simulation::ShotPath.Value && G::Attacking == 1 && !F::Aimbot.m_bRan)
|
||||
F::Visuals.ProjectileTrace(pLocal, pWeapon, false);
|
||||
|
||||
if (pLocal && Vars::Visuals::Particles::SpellFootsteps.Value && (F::Ticks.m_bDoubletap || F::Ticks.m_bWarp))
|
||||
if (pLocal && Vars::Visuals::Effects::SpellFootsteps.Value && (F::Ticks.m_bDoubletap || F::Ticks.m_bWarp))
|
||||
S::CTFPlayer_FireEvent.Call<void>(pLocal, pLocal->GetAbsOrigin(), QAngle(), 7001, nullptr);
|
||||
|
||||
static uint32_t iOldMedigunBeam = 0, iOldMedigunCharge = 0;
|
||||
uint32_t iNewMedigunBeam = FNV1A::Hash32(Vars::Visuals::Particles::MedigunBeam.Value.c_str()), iNewMedigunCharge = FNV1A::Hash32(Vars::Visuals::Particles::MedigunCharge.Value.c_str());
|
||||
uint32_t iNewMedigunBeam = FNV1A::Hash32(Vars::Visuals::Effects::MedigunBeam.Value.c_str()), iNewMedigunCharge = FNV1A::Hash32(Vars::Visuals::Effects::MedigunCharge.Value.c_str());
|
||||
if (iOldMedigunBeam != iNewMedigunBeam || iOldMedigunCharge != iNewMedigunCharge)
|
||||
{
|
||||
if (pWeapon && pWeapon->GetWeaponID() == TF_WEAPON_MEDIGUN)
|
||||
|
||||
@@ -8,6 +8,7 @@ struct Sightline_t
|
||||
Vec3 m_vStart = {};
|
||||
Vec3 m_vEnd = {};
|
||||
Color_t m_Color = {};
|
||||
bool m_bZBuffer = false;
|
||||
};
|
||||
|
||||
struct PickupData
|
||||
|
||||
@@ -19,16 +19,16 @@ MAKE_HOOK(CAttributeManager_AttribHookInt, S::CAttributeManager_AttribHookInt(),
|
||||
static const auto dwDesired = S::CTFPlayer_FireEvent_AttribHookValue_Call();
|
||||
const auto dwRetAddr = uintptr_t(_ReturnAddress());
|
||||
|
||||
if (!Vars::Visuals::Particles::SpellFootsteps.Value || econent != H::Entities.GetLocal() || I::EngineClient->IsTakingScreenshot() && Vars::Visuals::UI::CleanScreenshots.Value)
|
||||
if (!Vars::Visuals::Effects::SpellFootsteps.Value || econent != H::Entities.GetLocal() || I::EngineClient->IsTakingScreenshot() && Vars::Visuals::UI::CleanScreenshots.Value)
|
||||
return CALL_ORIGINAL(value, name, econent, buffer, isGlobalConstString);
|
||||
|
||||
if (dwRetAddr == dwDesired && FNV1A::Hash32(name) == FNV1A::Hash32Const("halloween_footstep_type"))
|
||||
{
|
||||
switch (Vars::Visuals::Particles::SpellFootsteps.Value)
|
||||
switch (Vars::Visuals::Effects::SpellFootsteps.Value)
|
||||
{
|
||||
case Vars::Visuals::Particles::SpellFootstepsEnum::Color: return ColorToInt(Vars::Colors::SpellFootstep.Value);
|
||||
case Vars::Visuals::Particles::SpellFootstepsEnum::Team: return 1;
|
||||
case Vars::Visuals::Particles::SpellFootstepsEnum::Halloween: return 2;
|
||||
case Vars::Visuals::Effects::SpellFootstepsEnum::Color: return ColorToInt(Vars::Colors::SpellFootstep.Value);
|
||||
case Vars::Visuals::Effects::SpellFootstepsEnum::Team: return 1;
|
||||
case Vars::Visuals::Effects::SpellFootstepsEnum::Halloween: return 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,13 +29,15 @@ MAKE_HOOK(CBaseEntity_FireBullets, S::CBaseEntity_FireBullets(), void,
|
||||
const bool bCrit = nDamageType & DMG_CRITICAL || pLocal->IsCritBoosted();
|
||||
const int iTeam = pLocal->m_iTeamNum();
|
||||
|
||||
auto& sString = bCrit ? Vars::Visuals::Particles::CritTrail.Value : Vars::Visuals::Particles::BulletTrail.Value;
|
||||
auto& sString = bCrit ? Vars::Visuals::Effects::CritTracer.Value : Vars::Visuals::Effects::BulletTracer.Value;
|
||||
auto uHash = FNV1A::Hash32(sString.c_str());
|
||||
if (!pLocal->IsInValidTeam() || uHash == FNV1A::Hash32Const("Off") || uHash == FNV1A::Hash32Const("Default"))
|
||||
if (!pLocal->IsInValidTeam() || uHash == FNV1A::Hash32Const("Default"))
|
||||
return CALL_ORIGINAL(rcx, pWeapon, info, bDoEffects, nDamageType, nCustomDamageType);
|
||||
|
||||
switch (uHash)
|
||||
{
|
||||
case FNV1A::Hash32Const("None"):
|
||||
return;
|
||||
case FNV1A::Hash32Const("Big nasty"):
|
||||
H::Particles.ParticleTracer(iTeam == TF_TEAM_RED ? "bullet_bignasty_tracer01_blue" : "bullet_bignasty_tracer01_red", trace.startpos, trace.endpos, pLocal->entindex(), iAttachment, true);
|
||||
break;
|
||||
@@ -99,9 +101,9 @@ MAKE_HOOK(CBaseEntity_FireBullets, S::CBaseEntity_FireBullets(), void,
|
||||
beamInfo.m_flSpeed = Vars::Visuals::Beams::Speed.Value;
|
||||
beamInfo.m_nStartFrame = 0;
|
||||
beamInfo.m_flFrameRate = 0;
|
||||
beamInfo.m_flRed = Vars::Visuals::Beams::BeamColor.Value.r;
|
||||
beamInfo.m_flGreen = Vars::Visuals::Beams::BeamColor.Value.g;
|
||||
beamInfo.m_flBlue = Vars::Visuals::Beams::BeamColor.Value.b;
|
||||
beamInfo.m_flRed = Vars::Visuals::Beams::Color.Value.r;
|
||||
beamInfo.m_flGreen = Vars::Visuals::Beams::Color.Value.g;
|
||||
beamInfo.m_flBlue = Vars::Visuals::Beams::Color.Value.b;
|
||||
beamInfo.m_nSegments = Vars::Visuals::Beams::Segments.Value;
|
||||
beamInfo.m_bRenderable = true;
|
||||
beamInfo.m_nFlags = Vars::Visuals::Beams::Flags.Value;
|
||||
|
||||
@@ -15,5 +15,5 @@ MAKE_HOOK(CBaseEntity_WorldSpaceCenter, S::CBaseEntity_WorldSpaceCenter(), const
|
||||
static const auto dwDesired = S::CDamageAccountPanel_DisplayDamageFeedback_CBaseEntity_WorldSpaceCenter_Call();
|
||||
const auto dwRetAddr = uintptr_t(_ReturnAddress());
|
||||
|
||||
return dwRetAddr == dwDesired && Vars::Visuals::Particles::DrawDamageNumbersThroughWalls.Value ? S::MainViewOrigin.Call<const Vec3&>() : CALL_ORIGINAL(rcx);
|
||||
return dwRetAddr == dwDesired && Vars::Visuals::Effects::DrawDamageNumbersThroughWalls.Value ? S::MainViewOrigin.Call<const Vec3&>() : CALL_ORIGINAL(rcx);
|
||||
}
|
||||
@@ -40,13 +40,13 @@ MAKE_HOOK(CBaseHudChatLine_InsertAndColorizeText, S::CBaseHudChatLine_InsertAndC
|
||||
sTag = "You", cColor = Vars::Colors::Local.Value.ToHexA();
|
||||
}
|
||||
else if (Vars::Visuals::UI::ChatTags.Value & Vars::Visuals::UI::ChatTagsEnum::Friends && H::Entities.IsFriend(clientIndex))
|
||||
sTag = "Friend", cColor = F::PlayerUtils.m_vTags[F::PlayerUtils.TagToIndex(FRIEND_TAG)].Color.ToHexA();
|
||||
sTag = "Friend", cColor = F::PlayerUtils.m_vTags[F::PlayerUtils.TagToIndex(FRIEND_TAG)].m_tColor.ToHexA();
|
||||
else if (Vars::Visuals::UI::ChatTags.Value & Vars::Visuals::UI::ChatTagsEnum::Party && H::Entities.InParty(clientIndex))
|
||||
sTag = "Party", cColor = F::PlayerUtils.m_vTags[F::PlayerUtils.TagToIndex(PARTY_TAG)].Color.ToHexA();
|
||||
sTag = "Party", cColor = F::PlayerUtils.m_vTags[F::PlayerUtils.TagToIndex(PARTY_TAG)].m_tColor.ToHexA();
|
||||
else if (Vars::Visuals::UI::ChatTags.Value & Vars::Visuals::UI::ChatTagsEnum::Assigned)
|
||||
{
|
||||
if (auto pTag = F::PlayerUtils.GetSignificantTag(clientIndex, 0))
|
||||
sTag = pTag->Name, cColor = pTag->Color.ToHexA();
|
||||
sTag = pTag->m_sName, cColor = pTag->m_tColor.ToHexA();
|
||||
}
|
||||
|
||||
if (!sTag.empty())
|
||||
|
||||
@@ -34,7 +34,7 @@ MAKE_HOOK(CClientModeShared_DoPostScreenSpaceEffects, U::Memory.GetVFunc(I::Clie
|
||||
F::Visuals.DrawLines();
|
||||
F::Visuals.DrawSightlines();
|
||||
|
||||
F::Chams.mEntities.clear();
|
||||
F::Chams.m_mEntities.clear();
|
||||
if (!I::EngineVGui->IsGameUIVisible() && pLocal && F::Materials.m_bLoaded)
|
||||
{
|
||||
F::Chams.RenderMain();
|
||||
|
||||
@@ -10,7 +10,7 @@ MAKE_HOOK(CHudCrosshair_GetDrawPosition, S::CHudCrosshair_GetDrawPosition(), voi
|
||||
return CALL_ORIGINAL(pX, pY, pbBehindCamera, angleCrosshairOffset);
|
||||
#endif
|
||||
|
||||
if (!Vars::Visuals::Viewmodel::CrosshairAim.Value && !Vars::Visuals::ThirdPerson::Crosshair.Value
|
||||
if (!Vars::Visuals::Viewmodel::CrosshairAim.Value && !Vars::Visuals::Thirdperson::Crosshair.Value
|
||||
|| Vars::Visuals::UI::CleanScreenshots.Value && I::EngineClient->IsTakingScreenshot())
|
||||
return CALL_ORIGINAL(pX, pY, pbBehindCamera, angleCrosshairOffset);
|
||||
|
||||
@@ -32,7 +32,7 @@ MAKE_HOOK(CHudCrosshair_GetDrawPosition, S::CHudCrosshair_GetDrawPosition(), voi
|
||||
}
|
||||
}
|
||||
|
||||
if (Vars::Visuals::ThirdPerson::Crosshair.Value && !bSet && I::Input->CAM_IsThirdPerson())
|
||||
if (Vars::Visuals::Thirdperson::Crosshair.Value && !bSet && I::Input->CAM_IsThirdPerson())
|
||||
{
|
||||
Vec3 vAngles = I::EngineClient->GetViewAngles();
|
||||
Vec3 vForward; Math::AngleVectors(vAngles, &vForward);
|
||||
|
||||
@@ -10,7 +10,7 @@ MAKE_HOOK(CL_CheckForPureServerWhitelist, S::CL_CheckForPureServerWhitelist(), v
|
||||
return CALL_ORIGINAL(pFilesToReload);
|
||||
#endif
|
||||
|
||||
if (Vars::Misc::Exploits::BypassPure.Value)
|
||||
if (Vars::Misc::Exploits::PureBypass.Value)
|
||||
return;
|
||||
|
||||
CALL_ORIGINAL(pFilesToReload);
|
||||
|
||||
@@ -72,11 +72,6 @@ MAKE_HOOK(CNetChannel_SendNetMsg, S::CNetChannel_SendNetMsg(), bool,
|
||||
// stop lag with voice chat
|
||||
bVoice = true;
|
||||
break;
|
||||
case clc_FileCRCCheck:
|
||||
// whitelist
|
||||
if (Vars::Misc::Exploits::BypassPure.Value)
|
||||
return false;
|
||||
break;
|
||||
case clc_RespondCvarValue:
|
||||
if (Vars::Misc::Game::AntiCheatCompatibility.Value)
|
||||
{
|
||||
|
||||
@@ -60,6 +60,15 @@ struct SpriteRenderInfo_t
|
||||
CParticleCollection* m_pParticles{};
|
||||
};
|
||||
|
||||
struct ParticleRenderData_t
|
||||
{
|
||||
float m_flSortKey;
|
||||
int m_nIndex;
|
||||
float m_flRadius;
|
||||
uint8 m_nAlpha;
|
||||
uint8 m_nAlphaPad[3];
|
||||
};
|
||||
|
||||
MAKE_HOOK(COPRenderSprites_Render, S::COPRenderSprites_Render(), void,
|
||||
void* rcx, IMatRenderContext* pRenderContext, CParticleCollection* pParticles, void* pContext)
|
||||
{
|
||||
@@ -68,7 +77,7 @@ MAKE_HOOK(COPRenderSprites_Render, S::COPRenderSprites_Render(), void,
|
||||
return CALL_ORIGINAL(rcx, pRenderContext, pParticles, pContext);
|
||||
#endif
|
||||
|
||||
if (!Vars::Visuals::Particles::DrawIconsThroughWalls.Value || Vars::Visuals::UI::CleanScreenshots.Value && I::EngineClient->IsTakingScreenshot())
|
||||
if (!Vars::Visuals::Effects::DrawIconsThroughWalls.Value || Vars::Visuals::UI::CleanScreenshots.Value && I::EngineClient->IsTakingScreenshot())
|
||||
return CALL_ORIGINAL(rcx, pRenderContext, pParticles, pContext);
|
||||
|
||||
bool bValid = false;
|
||||
@@ -154,7 +163,7 @@ MAKE_HOOK(COPRenderSprites_Render, S::COPRenderSprites_Render(), void,
|
||||
}
|
||||
|
||||
MAKE_HOOK(COPRenderSprites_RenderSpriteCard, S::COPRenderSprites_RenderSpriteCard(), void,
|
||||
void* rcx, void* meshBuilder, void* pCtx, SpriteRenderInfo_t& info, int hParticle, void* pSortList, void* pCamera)
|
||||
void* rcx, void* meshBuilder, void* pCtx, SpriteRenderInfo_t& info, int hParticle, ParticleRenderData_t* pSortList, void* pCamera)
|
||||
{
|
||||
#ifdef DEBUG_HOOKS
|
||||
if (!Vars::Hooks::COPRenderSprites_Render[DEFAULT_BIND])
|
||||
@@ -167,11 +176,13 @@ MAKE_HOOK(COPRenderSprites_RenderSpriteCard, S::COPRenderSprites_RenderSpriteCar
|
||||
info.m_pRGB[((hParticle / 4) * info.m_nRGBStride) + 0].m128_f32[hParticle & 0x3] = float(Vars::Colors::ParticleModulation.Value.r) / 255.f; // red
|
||||
info.m_pRGB[((hParticle / 4) * info.m_nRGBStride) + 1].m128_f32[hParticle & 0x3] = float(Vars::Colors::ParticleModulation.Value.g) / 255.f; // green
|
||||
info.m_pRGB[((hParticle / 4) * info.m_nRGBStride) + 2].m128_f32[hParticle & 0x3] = float(Vars::Colors::ParticleModulation.Value.b) / 255.f; // blue
|
||||
if (Vars::Colors::ParticleModulation.Value.a != 255)
|
||||
pSortList->m_nAlpha = Vars::Colors::ParticleModulation.Value.a;
|
||||
CALL_ORIGINAL(rcx, meshBuilder, pCtx, info, hParticle, pSortList, pCamera);
|
||||
}
|
||||
|
||||
MAKE_HOOK(COPRenderSprites_RenderTwoSequenceSpriteCard, S::COPRenderSprites_RenderTwoSequenceSpriteCard(), void,
|
||||
void* rcx, void* meshBuilder, void* pCtx, SpriteRenderInfo_t& info, int hParticle, void* pSortList, void* pCamera)
|
||||
void* rcx, void* meshBuilder, void* pCtx, SpriteRenderInfo_t& info, int hParticle, ParticleRenderData_t* pSortList, void* pCamera)
|
||||
{
|
||||
#ifdef DEBUG_HOOKS
|
||||
if (!Vars::Hooks::COPRenderSprites_Render[DEFAULT_BIND])
|
||||
@@ -184,5 +195,7 @@ MAKE_HOOK(COPRenderSprites_RenderTwoSequenceSpriteCard, S::COPRenderSprites_Rend
|
||||
info.m_pRGB[((hParticle / 4) * info.m_nRGBStride) + 0].m128_f32[hParticle & 0x3] = float(Vars::Colors::ParticleModulation.Value.r) / 255.f; // red
|
||||
info.m_pRGB[((hParticle / 4) * info.m_nRGBStride) + 1].m128_f32[hParticle & 0x3] = float(Vars::Colors::ParticleModulation.Value.g) / 255.f; // green
|
||||
info.m_pRGB[((hParticle / 4) * info.m_nRGBStride) + 2].m128_f32[hParticle & 0x3] = float(Vars::Colors::ParticleModulation.Value.b) / 255.f; // blue
|
||||
if (Vars::Colors::ParticleModulation.Value.a != 255)
|
||||
pSortList->m_nAlpha = Vars::Colors::ParticleModulation.Value.a;
|
||||
CALL_ORIGINAL(rcx, meshBuilder, pCtx, info, hParticle, pSortList, pCamera);
|
||||
}
|
||||
@@ -39,9 +39,9 @@ MAKE_HOOK(CParticleProperty_CreateName, S::CParticleProperty_CreateName(), void*
|
||||
bool bBlue = pLocal->m_iTeamNum() == TF_TEAM_BLUE;
|
||||
if (bUpdateEffects)
|
||||
{
|
||||
switch (FNV1A::Hash32(Vars::Visuals::Particles::MedigunBeam.Value.c_str()))
|
||||
switch (FNV1A::Hash32(Vars::Visuals::Effects::MedigunBeam.Value.c_str()))
|
||||
{
|
||||
case FNV1A::Hash32Const("Off"): break;
|
||||
case FNV1A::Hash32Const("Default"): break;
|
||||
case FNV1A::Hash32Const("None"): return nullptr;
|
||||
case FNV1A::Hash32Const("Uber"): pszParticleName = bBlue ? "medicgun_beam_blue_invun" : "medicgun_beam_red_invun"; break;
|
||||
case FNV1A::Hash32Const("Dispenser"): pszParticleName = bBlue ? "dispenser_heal_blue" : "dispenser_heal_red"; break;
|
||||
@@ -49,14 +49,14 @@ MAKE_HOOK(CParticleProperty_CreateName, S::CParticleProperty_CreateName(), void*
|
||||
case FNV1A::Hash32Const("Bombonomicon"): pszParticleName = "bombonomicon_spell_trail"; break;
|
||||
case FNV1A::Hash32Const("White"): pszParticleName = "medicgun_beam_machinery_stage3"; break;
|
||||
case FNV1A::Hash32Const("Orange"): pszParticleName = "medicgun_beam_red_trail_stage3"; break;
|
||||
default: pszParticleName = Vars::Visuals::Particles::MedigunBeam.Value.c_str();
|
||||
default: pszParticleName = Vars::Visuals::Effects::MedigunBeam.Value.c_str();
|
||||
}
|
||||
}
|
||||
else if (bManageChargeEffect)
|
||||
{
|
||||
switch (FNV1A::Hash32(Vars::Visuals::Particles::MedigunCharge.Value.c_str()))
|
||||
switch (FNV1A::Hash32(Vars::Visuals::Effects::MedigunCharge.Value.c_str()))
|
||||
{
|
||||
case FNV1A::Hash32Const("Off"): break;
|
||||
case FNV1A::Hash32Const("Default"): break;
|
||||
case FNV1A::Hash32Const("None"): return nullptr;
|
||||
case FNV1A::Hash32Const("Electrocuted"): pszParticleName = bBlue ? "electrocuted_blue" : "electrocuted_red"; break;
|
||||
case FNV1A::Hash32Const("Halloween"): pszParticleName = "ghost_pumpkin"; break;
|
||||
@@ -82,7 +82,7 @@ MAKE_HOOK(CParticleProperty_CreateName, S::CParticleProperty_CreateName(), void*
|
||||
case FNV1A::Hash32Const("Green souls"): pszParticleName = "unusual_souls_green_parent"; break;
|
||||
case FNV1A::Hash32Const("Bubbles"): pszParticleName = "unusual_bubbles"; break;
|
||||
case FNV1A::Hash32Const("Hearts"): pszParticleName = "unusual_hearts_bubbling"; break;
|
||||
default: pszParticleName = Vars::Visuals::Particles::MedigunCharge.Value.c_str();
|
||||
default: pszParticleName = Vars::Visuals::Effects::MedigunCharge.Value.c_str();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -98,7 +98,7 @@ MAKE_HOOK(CParticleProperty_CreatePoint, S::CParticleProperty_CreatePoint(), voi
|
||||
return CALL_ORIGINAL(rcx, pszParticleName, iAttachType, iAttachmentPoint, vecOriginOffset);
|
||||
#endif
|
||||
|
||||
if (FNV1A::Hash32(Vars::Visuals::Particles::ProjectileTrail.Value.c_str()) != FNV1A::Hash32Const("Off"))
|
||||
if (FNV1A::Hash32(Vars::Visuals::Effects::ProjectileTrail.Value.c_str()) != FNV1A::Hash32Const("Default"))
|
||||
{
|
||||
switch (FNV1A::Hash32(pszParticleName))
|
||||
{
|
||||
@@ -208,7 +208,7 @@ MAKE_HOOK(CParticleProperty_CreatePoint, S::CParticleProperty_CreatePoint(), voi
|
||||
return CALL_ORIGINAL(rcx, pszParticleName, iAttachType, iAttachmentPoint, vecOriginOffset);
|
||||
|
||||
bool bBlue = pLocal->m_iTeamNum() == TF_TEAM_BLUE;
|
||||
switch (FNV1A::Hash32(Vars::Visuals::Particles::ProjectileTrail.Value.c_str()))
|
||||
switch (FNV1A::Hash32(Vars::Visuals::Effects::ProjectileTrail.Value.c_str()))
|
||||
{
|
||||
case FNV1A::Hash32Const("None"): return nullptr;
|
||||
case FNV1A::Hash32Const("Rocket"): pszParticleName = "rockettrail"; break;
|
||||
@@ -230,7 +230,7 @@ MAKE_HOOK(CParticleProperty_CreatePoint, S::CParticleProperty_CreatePoint(), voi
|
||||
case FNV1A::Hash32Const("Monoculus"): pszParticleName = "eyeboss_projectile"; break;
|
||||
case FNV1A::Hash32Const("Sparkles"): pszParticleName = bBlue ? "burningplayer_rainbow_blue" : "burningplayer_rainbow_red"; break;
|
||||
case FNV1A::Hash32Const("Rainbow"): pszParticleName = "flamethrower_rainbow"; break;
|
||||
default: pszParticleName = Vars::Visuals::Particles::ProjectileTrail.Value.c_str();
|
||||
default: pszParticleName = Vars::Visuals::Effects::ProjectileTrail.Value.c_str();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -14,35 +14,35 @@ MAKE_HOOK(CTFHudDeathNotice_AddAdditionalMsg, S::CTFHudDeathNotice_AddAdditional
|
||||
return CALL_ORIGINAL(rcx, iKillerID, iVictimID, pMsgKey);
|
||||
#endif
|
||||
|
||||
if (iKillerID == I::EngineClient->GetLocalPlayer() && (!Vars::Visuals::Misc::LocalDominationOverride.Value.empty() || !Vars::Visuals::Misc::LocalRevengeOverride.Value.empty())
|
||||
|| (!Vars::Visuals::Misc::DominationOverride.Value.empty() || !Vars::Visuals::Misc::RevengeOverride.Value.empty()))
|
||||
if (iKillerID == I::EngineClient->GetLocalPlayer() && (!Vars::Visuals::Other::LocalDominationOverride.Value.empty() || !Vars::Visuals::Other::LocalRevengeOverride.Value.empty())
|
||||
|| (!Vars::Visuals::Other::DominationOverride.Value.empty() || !Vars::Visuals::Other::RevengeOverride.Value.empty()))
|
||||
{
|
||||
switch (FNV1A::Hash32(pMsgKey))
|
||||
{
|
||||
case FNV1A::Hash32Const("#Msg_Dominating"):
|
||||
case FNV1A::Hash32Const("#Msg_Dominating_What"):
|
||||
if (iKillerID == I::EngineClient->GetLocalPlayer() && !Vars::Visuals::Misc::LocalDominationOverride.Value.empty())
|
||||
if (iKillerID == I::EngineClient->GetLocalPlayer() && !Vars::Visuals::Other::LocalDominationOverride.Value.empty())
|
||||
{
|
||||
bShouldOverride = true;
|
||||
sOverride = SDK::ConvertUtf8ToWide(Vars::Visuals::Misc::LocalDominationOverride.Value);
|
||||
sOverride = SDK::ConvertUtf8ToWide(Vars::Visuals::Other::LocalDominationOverride.Value);
|
||||
}
|
||||
else if (!Vars::Visuals::Misc::DominationOverride.Value.empty())
|
||||
else if (!Vars::Visuals::Other::DominationOverride.Value.empty())
|
||||
{
|
||||
bShouldOverride = true;
|
||||
sOverride = SDK::ConvertUtf8ToWide(Vars::Visuals::Misc::DominationOverride.Value);
|
||||
sOverride = SDK::ConvertUtf8ToWide(Vars::Visuals::Other::DominationOverride.Value);
|
||||
}
|
||||
break;
|
||||
case FNV1A::Hash32Const("#Msg_Revenge"):
|
||||
case FNV1A::Hash32Const("#Msg_Revenge_What"):
|
||||
if (iKillerID == I::EngineClient->GetLocalPlayer() && !Vars::Visuals::Misc::LocalRevengeOverride.Value.empty())
|
||||
if (iKillerID == I::EngineClient->GetLocalPlayer() && !Vars::Visuals::Other::LocalRevengeOverride.Value.empty())
|
||||
{
|
||||
bShouldOverride = true;
|
||||
sOverride = SDK::ConvertUtf8ToWide(Vars::Visuals::Misc::LocalRevengeOverride.Value);
|
||||
sOverride = SDK::ConvertUtf8ToWide(Vars::Visuals::Other::LocalRevengeOverride.Value);
|
||||
}
|
||||
else if (!Vars::Visuals::Misc::RevengeOverride.Value.empty())
|
||||
else if (!Vars::Visuals::Other::RevengeOverride.Value.empty())
|
||||
{
|
||||
bShouldOverride = true;
|
||||
sOverride = SDK::ConvertUtf8ToWide(Vars::Visuals::Misc::RevengeOverride.Value);
|
||||
sOverride = SDK::ConvertUtf8ToWide(Vars::Visuals::Other::RevengeOverride.Value);
|
||||
}
|
||||
}
|
||||
if (bShouldOverride)
|
||||
|
||||
@@ -14,7 +14,7 @@ MAKE_HOOK(CTFPlayer_BRenderAsZombie, S::CTFPlayer_BRenderAsZombie(), bool,
|
||||
static const auto dwDesired = S::CTFRagdoll_CreateTFRagdoll_BRenderAsZombie_Call();
|
||||
const auto dwRetAddr = uintptr_t(_ReturnAddress());
|
||||
|
||||
if (Vars::Visuals::Ragdolls::NoGib.Value && dwRetAddr == dwDesired)
|
||||
if (Vars::Visuals::Removals::Gibs.Value && dwRetAddr == dwDesired)
|
||||
return true;
|
||||
|
||||
return CALL_ORIGINAL(rcx, bWeaponsCheck);
|
||||
|
||||
@@ -24,7 +24,7 @@ MAKE_HOOK(CTFPlayer_ShouldDraw, S::CTFPlayer_ShouldDraw(), bool,
|
||||
if (pLocal && pLocal->IsAlive() && rcx == pLocal->GetClientRenderable())
|
||||
return true;
|
||||
else if (pTarget && pTarget->IsAlive() && rcx == pTarget->GetClientRenderable())
|
||||
return Vars::Visuals::ThirdPerson::Enabled.Value;
|
||||
return Vars::Visuals::Thirdperson::Enabled.Value;
|
||||
}
|
||||
|
||||
return CALL_ORIGINAL(rcx);
|
||||
@@ -51,7 +51,7 @@ MAKE_HOOK(CBasePlayer_ShouldDrawThisPlayer, S::CBasePlayer_ShouldDrawThisPlayer(
|
||||
if (pLocal && pLocal->IsAlive() && rcx == pLocal)
|
||||
return true;
|
||||
else if (pTarget && pTarget->IsAlive() && rcx == pTarget)
|
||||
return Vars::Visuals::ThirdPerson::Enabled.Value;
|
||||
return Vars::Visuals::Thirdperson::Enabled.Value;
|
||||
}
|
||||
|
||||
return CALL_ORIGINAL(rcx);
|
||||
|
||||
@@ -10,34 +10,27 @@ MAKE_HOOK(CTFRagdoll_CreateTFRagdoll, S::CTFRagdoll_CreateTFRagdoll(), void,
|
||||
return CALL_ORIGINAL(rcx);
|
||||
#endif
|
||||
|
||||
if (Vars::Visuals::Ragdolls::NoRagdolls.Value)
|
||||
if (Vars::Visuals::Removals::Ragdolls.Value)
|
||||
return;
|
||||
|
||||
if (!Vars::Visuals::Ragdolls::Enabled.Value)
|
||||
if (!Vars::Visuals::Effects::RagdollEffects.Value)
|
||||
return CALL_ORIGINAL(rcx);
|
||||
|
||||
if (auto pRagdoll = reinterpret_cast<CTFRagdoll*>(rcx))
|
||||
{
|
||||
if (Vars::Visuals::Ragdolls::EnemyOnly.Value)
|
||||
{
|
||||
auto pLocal = H::Entities.GetLocal();
|
||||
if (pLocal && pRagdoll->m_iTeam() == pLocal->m_iTeamNum())
|
||||
return CALL_ORIGINAL(rcx);
|
||||
}
|
||||
auto pRagdoll = reinterpret_cast<CTFRagdoll*>(rcx);
|
||||
pRagdoll->m_bGib() = false;
|
||||
pRagdoll->m_bBurning() = Vars::Visuals::Effects::RagdollEffects.Value & Vars::Visuals::Effects::RagdollEffectsEnum::Burning;
|
||||
pRagdoll->m_bElectrocuted() = Vars::Visuals::Effects::RagdollEffects.Value & Vars::Visuals::Effects::RagdollEffectsEnum::Electrocuted;
|
||||
pRagdoll->m_bBecomeAsh() = Vars::Visuals::Effects::RagdollEffects.Value & Vars::Visuals::Effects::RagdollEffectsEnum::Ash;
|
||||
pRagdoll->m_bDissolving() = Vars::Visuals::Effects::RagdollEffects.Value & Vars::Visuals::Effects::RagdollEffectsEnum::Dissolve;
|
||||
pRagdoll->m_bGoldRagdoll() = Vars::Visuals::Effects::RagdollEffects.Value & Vars::Visuals::Effects::RagdollEffectsEnum::Gold;
|
||||
pRagdoll->m_bIceRagdoll() = Vars::Visuals::Effects::RagdollEffects.Value & Vars::Visuals::Effects::RagdollEffectsEnum::Ice;
|
||||
|
||||
pRagdoll->m_bGib() = false;
|
||||
pRagdoll->m_bBurning() = Vars::Visuals::Ragdolls::Effects.Value & Vars::Visuals::Ragdolls::EffectsEnum::Burning;
|
||||
pRagdoll->m_bElectrocuted() = Vars::Visuals::Ragdolls::Effects.Value & Vars::Visuals::Ragdolls::EffectsEnum::Electrocuted;
|
||||
pRagdoll->m_bBecomeAsh() = Vars::Visuals::Ragdolls::Effects.Value & Vars::Visuals::Ragdolls::EffectsEnum::Ash;
|
||||
pRagdoll->m_bDissolving() = Vars::Visuals::Ragdolls::Effects.Value & Vars::Visuals::Ragdolls::EffectsEnum::Dissolve;
|
||||
pRagdoll->m_bGoldRagdoll() = Vars::Visuals::Ragdolls::Type.Value == Vars::Visuals::Ragdolls::TypeEnum::Gold;
|
||||
pRagdoll->m_bIceRagdoll() = Vars::Visuals::Ragdolls::Type.Value == Vars::Visuals::Ragdolls::TypeEnum::Ice;
|
||||
|
||||
pRagdoll->m_vecForce() *= Vars::Visuals::Ragdolls::Force.Value;
|
||||
pRagdoll->m_vecForce().x *= Vars::Visuals::Ragdolls::ForceHorizontal.Value;
|
||||
pRagdoll->m_vecForce().y *= Vars::Visuals::Ragdolls::ForceHorizontal.Value;
|
||||
pRagdoll->m_vecForce().z *= Vars::Visuals::Ragdolls::ForceVertical.Value;
|
||||
}
|
||||
/*
|
||||
pRagdoll->m_vecForce() *= Vars::Visuals::Ragdolls::Force.Value;
|
||||
pRagdoll->m_vecForce().x *= Vars::Visuals::Ragdolls::ForceHorizontal.Value;
|
||||
pRagdoll->m_vecForce().y *= Vars::Visuals::Ragdolls::ForceHorizontal.Value;
|
||||
pRagdoll->m_vecForce().z *= Vars::Visuals::Ragdolls::ForceVertical.Value;
|
||||
*/
|
||||
|
||||
CALL_ORIGINAL(rcx);
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
#include "../SDK/SDK.h"
|
||||
|
||||
MAKE_SIGNATURE(CTFScatterGun_FireBullet, "client.dll", "E9 ? ? ? ? CC CC CC CC CC CC CC CC CC CC CC 48 89 74 24 ? 57 48 83 EC ? 48 8B F9 E8", 0x0);
|
||||
MAKE_SIGNATURE(CTFGameMovement_SetGroundEntity, "client.dll", "48 89 5C 24 ? 57 48 83 EC ? 48 8B D9 48 8B FA 48 8B 89 ? ? ? ? BA", 0x0);
|
||||
MAKE_SIGNATURE(CTFPlayer_ApplyAbsVelocityImpulse, "client.dll", "48 89 5C 24 ? 57 48 83 EC ? F3 0F 10 05 ? ? ? ? 48 8B FA", 0x0);
|
||||
MAKE_SIGNATURE(CTFPlayerShared_AddCond, "client.dll", "48 89 5C 24 ? 48 89 7C 24 ? 41 56 48 83 EC ? 48 8B F9 0F 29 74 24", 0x0);
|
||||
|
||||
static bool bScattergunJump = false;
|
||||
|
||||
static inline bool HasKnockback(CTFWeaponBase* pWeapon)
|
||||
{
|
||||
return SDK::AttribHookValue(0, "set_scattergun_has_knockback", pWeapon) == 1;
|
||||
}
|
||||
|
||||
static inline void StunPlayer(CTFPlayer* pPlayer, float flTime, float flReductionAmount, int iStunFlags, CTFPlayer* pAttacker = nullptr)
|
||||
{
|
||||
if (pPlayer->InCond(TF_COND_PHASE) || pPlayer->InCond(TF_COND_PASSTIME_INTERCEPTION) || pPlayer->InCond(TF_COND_MEGAHEAL)
|
||||
|| pPlayer->InCond(TF_COND_INVULNERABLE_HIDE_UNLESS_DAMAGED) && !pPlayer->InCond(TF_COND_MVM_BOT_STUN_RADIOWAVE))
|
||||
return;
|
||||
|
||||
S::CTFPlayerShared_AddCond.Call<void>(pPlayer->m_Shared(), TF_COND_STUNNED, -1.f, pAttacker);
|
||||
}
|
||||
|
||||
MAKE_HOOK(CTFScatterGun_FireBullet, S::CTFScatterGun_FireBullet(), void,
|
||||
void* rcx, CTFPlayer* pPlayer)
|
||||
{
|
||||
#ifdef DEBUG_HOOKS
|
||||
if (!Vars::Hooks::CTFScatterGun_FireBullet[DEFAULT_BIND])
|
||||
return CALL_ORIGINAL(rcx, pPlayer);
|
||||
#endif
|
||||
|
||||
auto pWeapon = reinterpret_cast<CTFWeaponBase*>(rcx);
|
||||
if (HasKnockback(pWeapon))
|
||||
{
|
||||
auto pGameRules = I::TFGameRules();
|
||||
if (pGameRules && pGameRules->m_iRoundState() == GR_STATE_PREROUND)
|
||||
return;
|
||||
|
||||
if (!(pPlayer->m_fFlags() & FL_ONGROUND) && !pPlayer->m_flPhysics())
|
||||
{
|
||||
pPlayer->m_flPhysics() = true;
|
||||
|
||||
StunPlayer(pPlayer, 0.3f, 1.f, TF_STUN_MOVEMENT | TF_STUN_MOVEMENT_FORWARD_ONLY);
|
||||
|
||||
VMatrix mtxPlayer;
|
||||
mtxPlayer.SetupMatrixOrgAngles(pPlayer->m_vecOrigin(), pPlayer->GetEyeAngles());
|
||||
Vector vecAbsVelocity = pPlayer->GetAbsVelocity();
|
||||
Vector vecAbsVelocityAsPoint = vecAbsVelocity + pPlayer->m_vecOrigin();
|
||||
Vector vecLocalVelocity = mtxPlayer.WorldToLocal(vecAbsVelocityAsPoint);
|
||||
|
||||
vecLocalVelocity.x = -300;
|
||||
|
||||
vecAbsVelocityAsPoint = mtxPlayer.LocalToWorld(vecLocalVelocity);
|
||||
vecAbsVelocity = vecAbsVelocityAsPoint - pPlayer->m_vecOrigin();
|
||||
pPlayer->SetAbsVelocity(vecAbsVelocity);
|
||||
|
||||
S::CTFPlayer_ApplyAbsVelocityImpulse.Call<void>(pPlayer, Vec3(0, 0, 50));
|
||||
|
||||
pPlayer->m_fFlags() &= ~FL_ONGROUND;
|
||||
}
|
||||
}
|
||||
|
||||
CALL_ORIGINAL(rcx, pPlayer);
|
||||
}
|
||||
|
||||
MAKE_HOOK(CTFGameMovement_SetGroundEntity, S::CTFGameMovement_SetGroundEntity(), void,
|
||||
void* rcx, trace_t* pm)
|
||||
{
|
||||
#ifdef DEBUG_HOOKS
|
||||
if (!Vars::Hooks::CTFScatterGun_FireBullet[DEFAULT_BIND])
|
||||
return CALL_ORIGINAL(rcx, pm);
|
||||
#endif
|
||||
|
||||
CALL_ORIGINAL(rcx, pm);
|
||||
|
||||
if (pm && pm->m_pEnt)
|
||||
{
|
||||
auto pPlayer = *reinterpret_cast<CTFPlayer**>(uintptr_t(rcx) + 5832);
|
||||
pPlayer->m_flPhysics() = false;
|
||||
}
|
||||
}
|
||||
@@ -21,17 +21,17 @@ MAKE_HOOK(CTFWeaponBase_GetShootSound, S::CTFWeaponBase_GetShootSound(), const c
|
||||
|
||||
int nOldTeam = pWeapon->m_iTeamNum();
|
||||
pWeapon->m_iTeamNum() = TF_TEAM_COUNT;
|
||||
auto ret = CALL_ORIGINAL(rcx, iIndex);
|
||||
auto sReturn = CALL_ORIGINAL(rcx, iIndex);
|
||||
pWeapon->m_iTeamNum() = nOldTeam;
|
||||
|
||||
switch (FNV1A::Hash32(ret))
|
||||
switch (FNV1A::Hash32(sReturn))
|
||||
{
|
||||
case FNV1A::Hash32Const("Weapon_FlameThrower.Fire"): return "MVM.GiantPyro_FlameStart";
|
||||
case FNV1A::Hash32Const("Weapon_FlameThrower.FireLoop"): return "MVM.GiantPyro_FlameLoop";
|
||||
case FNV1A::Hash32Const("Weapon_GrenadeLauncher.Single"): return "MVM.GiantDemoman_Grenadeshoot";
|
||||
}
|
||||
|
||||
return ret;
|
||||
return sReturn;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ MAKE_HOOK(IVModelRender_DrawModelExecute, U::Memory.GetVFunc(I::ModelRender, 19)
|
||||
#endif
|
||||
|
||||
/*
|
||||
if (!F::Chams.iRendering && !F::Glow.bRendering && !I::EngineVGui->IsGameUIVisible())
|
||||
if (!F::Chams.iRendering && !F::Glow.m_bRendering && !I::EngineVGui->IsGameUIVisible())
|
||||
{
|
||||
if (const auto& pEntity = I::ClientEntityList->GetClientEntity(pInfo.m_nEntIndex))
|
||||
Utils::ConLog("Entity", std::format("{}, {}, {}", pInfo.m_nEntIndex, int(pEntity->GetClassID()), I::ModelInfoClient->GetModelName(pInfo.m_pModel)).c_str());
|
||||
@@ -31,12 +31,12 @@ MAKE_HOOK(IVModelRender_DrawModelExecute, U::Memory.GetVFunc(I::ModelRender, 19)
|
||||
|| F::CameraWindow.m_bDrawing || !F::Materials.m_bLoaded || G::Unload)
|
||||
return CALL_ORIGINAL(rcx, pState, pInfo, pBoneToWorld);
|
||||
|
||||
if (F::Chams.bRendering)
|
||||
if (F::Chams.m_bRendering)
|
||||
return F::Chams.RenderHandler(pState, pInfo, pBoneToWorld);
|
||||
if (F::Glow.bRendering)
|
||||
if (F::Glow.m_bRendering)
|
||||
return F::Glow.RenderHandler(pState, pInfo, pBoneToWorld);
|
||||
|
||||
if (F::Chams.mEntities[pInfo.entity_index])
|
||||
if (F::Chams.m_mEntities[pInfo.entity_index])
|
||||
return;
|
||||
|
||||
auto pEntity = I::ClientEntityList->GetClientEntity(pInfo.entity_index);
|
||||
|
||||
@@ -12,7 +12,7 @@ MAKE_HOOK(IVModelRender_ForcedMaterialOverride, U::Memory.GetVFunc(I::ModelRende
|
||||
return CALL_ORIGINAL(rcx, mat, type);
|
||||
#endif
|
||||
|
||||
if (F::Chams.bRendering || F::Glow.bRendering)
|
||||
if (F::Chams.m_bRendering || F::Glow.m_bRendering)
|
||||
return;
|
||||
|
||||
CALL_ORIGINAL(rcx, mat, type);
|
||||
|
||||
@@ -14,8 +14,8 @@ MAKE_HOOK(R_DrawSkyBox, S::R_DrawSkyBox(), void,
|
||||
return CALL_ORIGINAL(zFar, nDrawFlags);
|
||||
|
||||
static auto sv_skyname = U::ConVars.FindVar("sv_skyname");
|
||||
const std::string original = sv_skyname->GetString();
|
||||
std::string sOriginal = sv_skyname->GetString();
|
||||
sv_skyname->SetValue(Vars::Visuals::World::SkyboxChanger.Value.c_str());
|
||||
CALL_ORIGINAL(zFar, nDrawFlags);
|
||||
sv_skyname->SetValue(original.c_str());
|
||||
sv_skyname->SetValue(sOriginal.c_str());
|
||||
}
|
||||
@@ -60,11 +60,11 @@ MAKE_HOOK(VGuiMenuBuilder_AddMenuItem, S::VGuiMenuBuilder_AddMenuItem(), void*,
|
||||
{
|
||||
int iID = std::distance(F::PlayerUtils.m_vTags.begin(), it);
|
||||
auto& tTag = *it;
|
||||
if (!tTag.Assignable)
|
||||
if (!tTag.m_bAssignable)
|
||||
continue;
|
||||
|
||||
bool bHasTag = F::PlayerUtils.HasTag(FriendsID, iID);
|
||||
CALL_ORIGINAL(rcx, std::format("{} {}", bHasTag ? "Remove" : "Add", tTag.Name).c_str(), std::format("modifytag{}", iID).c_str(), "tags");
|
||||
CALL_ORIGINAL(rcx, std::format("{} {}", bHasTag ? "Remove" : "Add", tTag.m_sName).c_str(), std::format("modifytag{}", iID).c_str(), "tags");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,26 +11,25 @@
|
||||
#define ANIMATION_CYCLE_BITS 10
|
||||
#define ANIMATION_CYCLE_MINFRAC (1.0f / (1<<ANIMATION_CYCLE_BITS))
|
||||
|
||||
//TODO: add game rules
|
||||
//#define VEC_VIEW g_pGameRules->GetViewVectors()->m_vView
|
||||
//#define VEC_HULL_MIN g_pGameRules->GetViewVectors()->m_vHullMin
|
||||
//#define VEC_HULL_MAX g_pGameRules->GetViewVectors()->m_vHullMax
|
||||
//#define VEC_DUCK_HULL_MIN g_pGameRules->GetViewVectors()->m_vDuckHullMin
|
||||
//#define VEC_DUCK_HULL_MAX g_pGameRules->GetViewVectors()->m_vDuckHullMax
|
||||
//#define VEC_DUCK_VIEW g_pGameRules->GetViewVectors()->m_vDuckView
|
||||
//#define VEC_OBS_HULL_MIN g_pGameRules->GetViewVectors()->m_vObsHullMin
|
||||
//#define VEC_OBS_HULL_MAX g_pGameRules->GetViewVectors()->m_vObsHullMax
|
||||
//#define VEC_DEAD_VIEWHEIGHT g_pGameRules->GetViewVectors()->m_vDeadViewHeight
|
||||
#define VEC_VIEW pGameRules->GetViewVectors()->m_vView
|
||||
#define VEC_HULL_MIN pGameRules->GetViewVectors()->m_vHullMin
|
||||
#define VEC_HULL_MAX pGameRules->GetViewVectors()->m_vHullMax
|
||||
#define VEC_DUCK_HULL_MIN pGameRules->GetViewVectors()->m_vDuckHullMin
|
||||
#define VEC_DUCK_HULL_MAX pGameRules->GetViewVectors()->m_vDuckHullMax
|
||||
#define VEC_DUCK_VIEW pGameRules->GetViewVectors()->m_vDuckView
|
||||
#define VEC_OBS_HULL_MIN pGameRules->GetViewVectors()->m_vObsHullMin
|
||||
#define VEC_OBS_HULL_MAX pGameRules->GetViewVectors()->m_vObsHullMax
|
||||
#define VEC_DEAD_VIEWHEIGHT pGameRules->GetViewVectors()->m_vDeadViewHeight
|
||||
|
||||
//#define VEC_VIEW_SCALED( player ) ( g_pGameRules->GetViewVectors()->m_vView * player->GetModelScale() )
|
||||
//#define VEC_HULL_MIN_SCALED( player ) ( g_pGameRules->GetViewVectors()->m_vHullMin * player->GetModelScale() )
|
||||
//#define VEC_HULL_MAX_SCALED( player ) ( g_pGameRules->GetViewVectors()->m_vHullMax * player->GetModelScale() )
|
||||
//#define VEC_DUCK_HULL_MIN_SCALED( player ) ( g_pGameRules->GetViewVectors()->m_vDuckHullMin * player->GetModelScale() )
|
||||
//#define VEC_DUCK_HULL_MAX_SCALED( player ) ( g_pGameRules->GetViewVectors()->m_vDuckHullMax * player->GetModelScale() )
|
||||
//#define VEC_DUCK_VIEW_SCALED( player ) ( g_pGameRules->GetViewVectors()->m_vDuckView * player->GetModelScale() )
|
||||
//#define VEC_OBS_HULL_MIN_SCALED( player ) ( g_pGameRules->GetViewVectors()->m_vObsHullMin * player->GetModelScale() )
|
||||
//#define VEC_OBS_HULL_MAX_SCALED( player ) ( g_pGameRules->GetViewVectors()->m_vObsHullMax * player->GetModelScale() )
|
||||
//#define VEC_DEAD_VIEWHEIGHT_SCALED( player ) ( g_pGameRules->GetViewVectors()->m_vDeadViewHeight * player->GetModelScale() )
|
||||
#define VEC_VIEW_SCALED(player) (pGameRules->GetViewVectors()->m_vView * player->m_flModelScale())
|
||||
#define VEC_HULL_MIN_SCALED(player) (pGameRules->GetViewVectors()->m_vHullMin * player->m_flModelScale())
|
||||
#define VEC_HULL_MAX_SCALED(player) (pGameRules->GetViewVectors()->m_vHullMax * player->m_flModelScale())
|
||||
#define VEC_DUCK_HULL_MIN_SCALED(player) (pGameRules->GetViewVectors()->m_vDuckHullMin * player->m_flModelScale())
|
||||
#define VEC_DUCK_HULL_MAX_SCALED(player) (pGameRules->GetViewVectors()->m_vDuckHullMax * player->m_flModelScale())
|
||||
#define VEC_DUCK_VIEW_SCALED(player) (pGameRules->GetViewVectors()->m_vDuckView * player->m_flModelScale())
|
||||
#define VEC_OBS_HULL_MIN_SCALED(player) (pGameRules->GetViewVectors()->m_vObsHullMin * player->m_flModelScale())
|
||||
#define VEC_OBS_HULL_MAX_SCALED(player) (pGameRules->GetViewVectors()->m_vObsHullMax * player->m_flModelScale())
|
||||
#define VEC_DEAD_VIEWHEIGHT_SCALED(player) (pGameRules->GetViewVectors()->m_vDeadViewHeight * player->m_flModelScale())
|
||||
|
||||
#define WATERJUMP_HEIGHT 8
|
||||
|
||||
@@ -372,7 +371,7 @@
|
||||
#define FL_CLIENT (1<<7)
|
||||
#define FL_FAKECLIENT (1<<8)
|
||||
#define FL_INWATER (1<<9)
|
||||
#define PLAYER_FLAG_BITS 10
|
||||
#define PLAYER_FLAG_BITS 32
|
||||
|
||||
#define LIFE_ALIVE 0
|
||||
#define LIFE_DYING 1
|
||||
|
||||
@@ -28,15 +28,60 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
struct CTFLobbyPlayerProto
|
||||
{
|
||||
enum TF_GC_TEAM
|
||||
{
|
||||
TF_GC_TEAM_DEFENDERS = 0,
|
||||
TF_GC_TEAM_INVADERS = 1,
|
||||
TF_GC_TEAM_BROADCASTER = 2,
|
||||
TF_GC_TEAM_SPECTATOR = 3,
|
||||
TF_GC_TEAM_PLAYER_POOL = 4,
|
||||
TF_GC_TEAM_NOTEAM = 5
|
||||
};
|
||||
|
||||
enum ConnectState
|
||||
{
|
||||
INVALID = 0,
|
||||
RESERVATION_PENDING = 1,
|
||||
RESERVED = 2,
|
||||
CONNECTED = 3,
|
||||
CONNECTED_AD_HOC = 4,
|
||||
DISCONNECTED = 5
|
||||
};
|
||||
|
||||
enum Type {
|
||||
INVALID_PLAYER = 0,
|
||||
MATCH_PLAYER = 1,
|
||||
STANDBY_PLAYER = 2,
|
||||
OBSERVING_PLAYER = 3
|
||||
};
|
||||
|
||||
byte pad0[24];
|
||||
uint64 id;
|
||||
TF_GC_TEAM team;
|
||||
ConnectState connect_state;
|
||||
const char* name;
|
||||
uint64 original_party_id;
|
||||
uint32 badge_level;
|
||||
uint32 last_connect_time;
|
||||
Type type;
|
||||
bool squad_surplus;
|
||||
bool chat_suspension;
|
||||
double normalized_rating;
|
||||
double normalized_uncertainty;
|
||||
uint32 rank;
|
||||
};
|
||||
|
||||
class ConstTFLobbyPlayer
|
||||
{
|
||||
void* pad0;
|
||||
void* pad1;
|
||||
|
||||
public:
|
||||
inline void* Proto()
|
||||
inline CTFLobbyPlayerProto* Proto()
|
||||
{
|
||||
auto ConstTFLobbyPlayer_Proto = reinterpret_cast<void*(*)(void*)>(U::Memory.GetVFunc(this, 0));
|
||||
auto ConstTFLobbyPlayer_Proto = reinterpret_cast<CTFLobbyPlayerProto*(*)(void*)>(U::Memory.GetVFunc(this, 0));
|
||||
return ConstTFLobbyPlayer_Proto(this);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -204,9 +204,9 @@ public:
|
||||
VIRTUAL(GetSlot, int, void*, this, 331);
|
||||
VIRTUAL(GetWeaponID, int, void*, this, 382);
|
||||
VIRTUAL(GetDamageType, int, void*, this, 383);
|
||||
VIRTUAL(IsEnergyWeapon, bool, void*, this, 433);
|
||||
VIRTUAL(AreRandomCritsEnabled, bool, void*, this, 403);
|
||||
VIRTUAL(GetWeaponSpread, float, void*, this, 468);
|
||||
VIRTUAL(IsEnergyWeapon, bool, void*, this, 434);
|
||||
VIRTUAL(AreRandomCritsEnabled, bool, void*, this, 404);
|
||||
VIRTUAL(GetWeaponSpread, float, void*, this, 469);
|
||||
|
||||
OFFSET(m_iWeaponMode, int, 996);
|
||||
|
||||
@@ -228,7 +228,7 @@ public:
|
||||
|
||||
int& iFOV = pOwner->m_iFOV(), nFovBackup = iFOV;
|
||||
iFOV = 70;
|
||||
bool bReturn = reinterpret_cast<bool(*)(void*, bool, void*)>(U::Memory.GetVFunc(this, 426))(this, bIsHeadshot, nullptr);
|
||||
bool bReturn = reinterpret_cast<bool(*)(void*, bool, void*)>(U::Memory.GetVFunc(this, 427))(this, bIsHeadshot, nullptr);
|
||||
iFOV = nFovBackup;
|
||||
return bReturn;
|
||||
}
|
||||
@@ -347,7 +347,7 @@ public:
|
||||
|
||||
inline void GetProjectileFireSetup(void* pPlayer, Vector vecOffset, Vector* vecSrc, QAngle* angForward, bool bHitTeammates = true, float flEndDist = 2000.f)
|
||||
{
|
||||
reinterpret_cast<void(*)(CTFWeaponBase*, void*, Vector, Vector*, QAngle*, bool, float)>(U::Memory.GetVFunc(this, 400))(this, pPlayer, vecOffset, vecSrc, angForward, bHitTeammates, flEndDist);
|
||||
reinterpret_cast<void(*)(CTFWeaponBase*, void*, Vector, Vector*, QAngle*, bool, float)>(U::Memory.GetVFunc(this, 401))(this, pPlayer, vecOffset, vecSrc, angForward, bHitTeammates, flEndDist);
|
||||
}
|
||||
|
||||
inline void GetSpreadAngles(Vec3& out)
|
||||
@@ -369,7 +369,7 @@ public:
|
||||
|
||||
inline float ApplyFireDelay(float flDelay)
|
||||
{
|
||||
return reinterpret_cast<float(*)(void*, float)>(U::Memory.GetVFunc(this, 408))(this, flDelay);
|
||||
return reinterpret_cast<float(*)(void*, float)>(U::Memory.GetVFunc(this, 409))(this, flDelay);
|
||||
}
|
||||
|
||||
inline bool CalcIsAttackCriticalHelperMelee()
|
||||
|
||||
@@ -846,6 +846,41 @@ struct Color_t
|
||||
a = byte(std::clamp(flA, 0.f, 255.f));
|
||||
}
|
||||
|
||||
inline void GetHSV(float& flH, float& flS, float& flV)
|
||||
{
|
||||
float flR = this->r / 255.f;
|
||||
float flG = this->g / 255.f;
|
||||
float flB = this->b / 255.f;
|
||||
|
||||
float flK = 0.f;
|
||||
if (flG < flB)
|
||||
{
|
||||
float flTemp = flG;
|
||||
flG = flB;
|
||||
flB = flTemp;
|
||||
flK = -1.f;
|
||||
}
|
||||
if (flR < flG)
|
||||
{
|
||||
float flTemp = flR;
|
||||
flR = flG;
|
||||
flG = flTemp;
|
||||
flK = -2.f / 6.f - flK;
|
||||
}
|
||||
|
||||
float flChroma = flR - (flG < flB ? flG : flB);
|
||||
flH = fabsf(flK + (flG - flB) / (6.f * flChroma + FLT_EPSILON)) * 360;
|
||||
flS = flChroma / (flR + FLT_EPSILON) * 100;
|
||||
flV = flR * 100;
|
||||
}
|
||||
|
||||
inline Color_t HueShift(float flShift)
|
||||
{
|
||||
float flH, flS, flV; GetHSV(flH, flS, flV);
|
||||
Color_t tOut; tOut.SetHSV(fmodf(flH + flShift, 360.f), flS, flV, this->a);
|
||||
return tOut;
|
||||
}
|
||||
|
||||
inline bool operator==(Color_t other) const
|
||||
{
|
||||
return r == other.r && g == other.g && b == other.b && a == other.a;
|
||||
|
||||
@@ -10,7 +10,7 @@ struct DrawLine_t
|
||||
{
|
||||
std::pair<Vec3, Vec3> m_vPair;
|
||||
float m_flTime;
|
||||
Color_t m_color;
|
||||
Color_t m_tColor;
|
||||
bool m_bZBuffer = false;
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ struct DrawPath_t
|
||||
{
|
||||
std::deque<Vec3> m_vPath;
|
||||
float m_flTime;
|
||||
Color_t m_color;
|
||||
Color_t m_tColor;
|
||||
int m_iStyle;
|
||||
bool m_bZBuffer = false;
|
||||
};
|
||||
|
||||
@@ -35,17 +35,17 @@ Color_t CColor::GetEntityDrawColor(CTFPlayer* pLocal, CBaseEntity* pEntity, bool
|
||||
}
|
||||
else if (H::Entities.IsFriend(pPlayer->entindex()))
|
||||
{
|
||||
out = F::PlayerUtils.m_vTags[F::PlayerUtils.TagToIndex(FRIEND_TAG)].Color;
|
||||
out = F::PlayerUtils.m_vTags[F::PlayerUtils.TagToIndex(FRIEND_TAG)].m_tColor;
|
||||
if (pType) *pType = 3;
|
||||
}
|
||||
else if (H::Entities.InParty(pPlayer->entindex()))
|
||||
{
|
||||
out = F::PlayerUtils.m_vTags[F::PlayerUtils.TagToIndex(PARTY_TAG)].Color;
|
||||
out = F::PlayerUtils.m_vTags[F::PlayerUtils.TagToIndex(PARTY_TAG)].m_tColor;
|
||||
if (pType) *pType = 4;
|
||||
}
|
||||
else if (auto pTag = F::PlayerUtils.GetSignificantTag(pPlayer->entindex()))
|
||||
{
|
||||
out = pTag->Color;
|
||||
out = pTag->m_tColor;
|
||||
if (pType) *pType = 5;
|
||||
}
|
||||
}
|
||||
@@ -66,11 +66,11 @@ Color_t CColor::GetScoreboardColor(int iIndex)
|
||||
if (iIndex == I::EngineClient->GetLocalPlayer())
|
||||
out = Vars::Colors::Local.Value;
|
||||
else if (H::Entities.IsFriend(iIndex))
|
||||
out = F::PlayerUtils.m_vTags[F::PlayerUtils.TagToIndex(FRIEND_TAG)].Color;
|
||||
out = F::PlayerUtils.m_vTags[F::PlayerUtils.TagToIndex(FRIEND_TAG)].m_tColor;
|
||||
else if (H::Entities.InParty(iIndex))
|
||||
out = F::PlayerUtils.m_vTags[F::PlayerUtils.TagToIndex(PARTY_TAG)].Color;
|
||||
out = F::PlayerUtils.m_vTags[F::PlayerUtils.TagToIndex(PARTY_TAG)].m_tColor;
|
||||
else if (auto pTag = F::PlayerUtils.GetSignificantTag(iIndex))
|
||||
out = pTag->Color;
|
||||
out = pTag->m_tColor;
|
||||
|
||||
return out;
|
||||
}
|
||||
@@ -144,17 +144,15 @@ void CEntities::Store()
|
||||
|
||||
static Timer tTimer = {};
|
||||
bool bShouldUpdateInfo = tTimer.Run(1.f);
|
||||
static auto sv_maxusrcmdprocessticks = U::ConVars.FindVar("sv_maxusrcmdprocessticks");
|
||||
int iMaxShift = sv_maxusrcmdprocessticks->GetInt();
|
||||
int iLag;
|
||||
{
|
||||
static int iStaticTickcout = I::GlobalVars->tickcount;
|
||||
iLag = I::GlobalVars->tickcount - iStaticTickcout - 1;
|
||||
iStaticTickcout = I::GlobalVars->tickcount;
|
||||
}
|
||||
std::unordered_map<uint32_t, bool> mParty = {};
|
||||
std::unordered_map<uint32_t, uint64_t> mParties = {};
|
||||
std::unordered_map<uint32_t, bool> mF2P = {};
|
||||
std::unordered_map<int, int> mLevels = {};
|
||||
std::unordered_map<uint32_t, int> mLevels = {};
|
||||
if (bShouldUpdateInfo)
|
||||
{
|
||||
m_mIFriends.clear();
|
||||
@@ -168,33 +166,29 @@ void CEntities::Store()
|
||||
m_mIPriorities.clear();
|
||||
m_mUPriorities.clear();
|
||||
|
||||
if (auto pParty = I::TFGCClientSystem->GetParty())
|
||||
{
|
||||
for (int i = 0; i < pParty->GetNumMembers(); i++)
|
||||
{
|
||||
auto cSteamID = CSteamID(); pParty->GetMember(&cSteamID, i);
|
||||
mParty[cSteamID.GetAccountID()] = true;
|
||||
}
|
||||
}
|
||||
if (auto pLobby = I::TFGCClientSystem->GetLobby())
|
||||
{
|
||||
for (int i = 0; i < pLobby->GetNumMembers(); i++)
|
||||
{
|
||||
auto cSteamID = CSteamID(); pLobby->GetMember(&cSteamID, i);
|
||||
auto uFriendsID = cSteamID.GetAccountID();
|
||||
|
||||
ConstTFLobbyPlayer pDetails;
|
||||
pLobby->GetMemberDetails(&pDetails, i);
|
||||
|
||||
mF2P[cSteamID.GetAccountID()] = *reinterpret_cast<bool*>(uintptr_t(pDetails.Proto()) + 69);
|
||||
|
||||
auto pProto = pDetails.Proto();
|
||||
mF2P[uFriendsID] = pProto->chat_suspension;
|
||||
mLevels[uFriendsID] = pProto->rank;
|
||||
mParties[uFriendsID] = pProto->original_party_id;
|
||||
}
|
||||
}
|
||||
if (auto pGameRules = I::TFGameRules())
|
||||
if (auto pParty = I::TFGCClientSystem->GetParty())
|
||||
{
|
||||
auto pMatchDesc = pGameRules->GetMatchGroupDescription();
|
||||
if (pMatchDesc && pMatchDesc->m_pProgressionDesc)
|
||||
for (int i = 0; i < pParty->GetNumMembers(); i++)
|
||||
{
|
||||
for (int n = 1; n <= I::EngineClient->GetMaxClients(); n++)
|
||||
mLevels[n] = pMatchDesc->GetLevelForIndex(n);
|
||||
auto cSteamID = CSteamID(); pParty->GetMember(&cSteamID, i);
|
||||
auto uFriendsID = cSteamID.GetAccountID();
|
||||
mParties[uFriendsID] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -205,11 +199,14 @@ void CEntities::Store()
|
||||
PlayerInfo_t pi{};
|
||||
if (I::EngineClient->GetPlayerInfo(n, &pi) && !pi.fakeplayer)
|
||||
{
|
||||
bool bLocal = n == I::EngineClient->GetLocalPlayer();
|
||||
m_mIPriorities[n] = m_mUPriorities[pi.friendsID] = !bLocal ? F::PlayerUtils.GetPriority(pi.friendsID, false) : 0;
|
||||
m_mIFriends[n] = m_mUFriends[pi.friendsID] = I::SteamFriends->HasFriend({ pi.friendsID, 1, k_EUniversePublic, k_EAccountTypeIndividual }, k_EFriendFlagImmediate);
|
||||
m_mIParty[n] = m_mUParty[pi.friendsID] = mParty.contains(pi.friendsID) && n != I::EngineClient->GetLocalPlayer();
|
||||
m_mIParty[n] = m_mUParty[pi.friendsID] = mParties.contains(pi.friendsID) ? mParties[pi.friendsID] : 0;
|
||||
m_mIF2P[n] = m_mUF2P[pi.friendsID] = mF2P.contains(pi.friendsID) ? mF2P[pi.friendsID] : false;
|
||||
m_mILevels[n] = m_mULevels[pi.friendsID] = mLevels.contains(n) ? mLevels[n] : -2;
|
||||
m_mIPriorities[n] = m_mUPriorities[pi.friendsID] = n != I::EngineClient->GetLocalPlayer() ? F::PlayerUtils.GetPriority(pi.friendsID, false) : 0;
|
||||
m_mILevels[n] = m_mULevels[pi.friendsID] = mLevels.contains(pi.friendsID) ? mLevels[pi.friendsID] : -2;
|
||||
if (bLocal)
|
||||
m_uFriendsID = pi.friendsID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,7 +224,7 @@ void CEntities::Store()
|
||||
if (m_mDormancy.contains(n))
|
||||
{
|
||||
auto& tDormancy = m_mDormancy[n];
|
||||
if (I::EngineClient->Time() - tDormancy.LastUpdate < Vars::ESP::DormantTime.Value)
|
||||
if (I::EngineClient->Time() - tDormancy.LastUpdate < Vars::ESP::DormantDuration.Value)
|
||||
pPlayer->SetAbsOrigin(pPlayer->m_vecOrigin() = tDormancy.Location);
|
||||
else
|
||||
m_mDormancy.erase(n);
|
||||
@@ -246,7 +243,7 @@ void CEntities::Store()
|
||||
bool bDormant = pPlayer->IsDormant();
|
||||
float flOldSimTime = m_mOldSimTimes[n] = m_mSimTimes.contains(n) ? m_mSimTimes[n] : pPlayer->m_flOldSimulationTime();
|
||||
float flSimTime = m_mSimTimes[n] = (bDormant ? m_pLocal : pPlayer)->m_flSimulationTime(); // lol
|
||||
float flDeltaTime = m_mDeltaTimes[n] = TICKS_TO_TIME(std::clamp(TIME_TO_TICKS(flSimTime - flOldSimTime) - iLag, 0, iMaxShift));
|
||||
float flDeltaTime = m_mDeltaTimes[n] = TICKS_TO_TIME(std::clamp(TIME_TO_TICKS(flSimTime - flOldSimTime) - iLag, 0, 24));
|
||||
if (flDeltaTime)
|
||||
{
|
||||
if (pPlayer->IsAlive() && !bDormant)
|
||||
@@ -255,7 +252,7 @@ void CEntities::Store()
|
||||
|
||||
if (!bDormant)
|
||||
{
|
||||
m_mOrigins[n].emplace_front(pPlayer->m_vecOrigin() + Vec3(0, 0, pPlayer->m_vecMaxs().z - pPlayer->m_vecMins().z), pPlayer->m_flSimulationTime());
|
||||
m_mOrigins[n].emplace_front(pPlayer->m_vecOrigin() + Vec3(0, 0, pPlayer->m_vecMaxs().z - pPlayer->m_vecMins().z), flSimTime);
|
||||
if (m_mOrigins[n].size() > Vars::Aimbot::Projectile::VelocityAverageCount.Value)
|
||||
m_mOrigins[n].pop_back();
|
||||
}
|
||||
@@ -276,9 +273,8 @@ void CEntities::Store()
|
||||
m_mBones[n].first = pPlayer->SetupBones(m_mBones[n].second, MAXSTUDIOBONES, BONE_USED_BY_ANYTHING, flSimTime);
|
||||
m_bSettingUpBones = false;
|
||||
|
||||
Vec3 vOldAngles = m_mEyeAngles[n], vNewAngles = pPlayer->As<CTFPlayer>()->GetEyeAngles();
|
||||
m_mEyeAngles[n] = vNewAngles;
|
||||
m_mPingAngles[n] = (vNewAngles - vOldAngles) / (flSimTime - flOldSimTime) * (F::Backtrack.GetReal() + TICKS_TO_TIME(F::Backtrack.GetAnticipatedChoke()));
|
||||
m_mOldAngles[n] = m_mEyeAngles[n];
|
||||
m_mEyeAngles[n] = pPlayer->As<CTFPlayer>()->GetEyeAngles();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -299,7 +295,7 @@ void CEntities::Clear(bool bShutdown)
|
||||
m_mDormancy.clear();
|
||||
m_mBones.clear();
|
||||
m_mEyeAngles.clear();
|
||||
m_mPingAngles.clear();
|
||||
m_mOldAngles.clear();
|
||||
m_mLagCompensation.clear();
|
||||
}
|
||||
}
|
||||
@@ -478,7 +474,7 @@ int CEntities::GetChoke(int iIndex) { return m_mChokes.contains(iIndex) ? m_mCho
|
||||
bool CEntities::GetDormancy(int iIndex) { return m_mDormancy.contains(iIndex); }
|
||||
matrix3x4* CEntities::GetBones(int iIndex) { return m_mBones[iIndex].first ? m_mBones[iIndex].second : nullptr; }
|
||||
Vec3 CEntities::GetEyeAngles(int iIndex) { return m_mEyeAngles.contains(iIndex) ? m_mEyeAngles[iIndex] : Vec3(); }
|
||||
Vec3 CEntities::GetPingAngles(int iIndex) { return m_mPingAngles.contains(iIndex) ? m_mPingAngles[iIndex] : Vec3(); }
|
||||
Vec3 CEntities::GetPingAngles(int iIndex) { return m_mOldAngles.contains(iIndex) ? (m_mEyeAngles[iIndex] - m_mOldAngles[iIndex]) / GetDeltaTime(iIndex) * (F::Backtrack.GetReal() + TICKS_TO_TIME(F::Backtrack.GetAnticipatedChoke())) : Vec3(); }
|
||||
bool CEntities::GetLagCompensation(int iIndex) { return m_mLagCompensation[iIndex]; }
|
||||
void CEntities::SetLagCompensation(int iIndex, bool bLagComp) { m_mLagCompensation[iIndex] = bLagComp; }
|
||||
Vec3* CEntities::GetAvgVelocity(int iIndex) { return iIndex != I::EngineClient->GetLocalPlayer() ? &m_mAvgVelocities[iIndex] : nullptr; }
|
||||
@@ -486,15 +482,17 @@ void CEntities::SetAvgVelocity(int iIndex, Vec3 vAvgVelocity) { m_mAvgVelocities
|
||||
uint32_t CEntities::GetModel(int iIndex) { return m_mModels[iIndex]; }
|
||||
std::deque<VelFixRecord>* CEntities::GetOrigins(int iIndex) { return m_mOrigins.contains(iIndex) ? &m_mOrigins[iIndex] : nullptr; }
|
||||
|
||||
int CEntities::GetPriority(int iIndex) { return m_mIPriorities[iIndex]; }
|
||||
int CEntities::GetPriority(uint32_t uFriendsID) { return m_mUPriorities[uFriendsID]; }
|
||||
bool CEntities::IsFriend(int iIndex) { return m_mIFriends[iIndex]; }
|
||||
bool CEntities::IsFriend(uint32_t uFriendsID) { return m_mUFriends[uFriendsID]; }
|
||||
bool CEntities::InParty(int iIndex) { return m_mIParty[iIndex]; }
|
||||
bool CEntities::InParty(uint32_t uFriendsID) { return m_mUParty[uFriendsID]; }
|
||||
bool CEntities::InParty(int iIndex) { return iIndex != I::EngineClient->GetLocalPlayer() && m_mIParty[iIndex] == 1; }
|
||||
bool CEntities::InParty(uint32_t uFriendsID) { return uFriendsID != m_uFriendsID && m_mUParty[uFriendsID] == 1; }
|
||||
bool CEntities::IsF2P(int iIndex) { return m_mIF2P[iIndex]; }
|
||||
bool CEntities::IsF2P(uint32_t uFriendsID) { return m_mUF2P[uFriendsID]; }
|
||||
int CEntities::GetLevel(int iIndex) { return m_mILevels.contains(iIndex) ? m_mILevels[iIndex] : -2; }
|
||||
int CEntities::GetLevel(uint32_t uFriendsID) { return m_mULevels.contains(uFriendsID) ? m_mULevels[uFriendsID] : -2; }
|
||||
int CEntities::GetPriority(int iIndex) { return m_mIPriorities[iIndex]; }
|
||||
int CEntities::GetPriority(uint32_t uFriendsID) { return m_mUPriorities[uFriendsID]; }
|
||||
uint64_t CEntities::GetParty(int iIndex) { return m_mIParty.contains(iIndex) ? m_mIParty[iIndex] : 0; }
|
||||
uint64_t CEntities::GetParty(uint32_t uFriendsID) { return m_mUParty.contains(uFriendsID) ? m_mUParty[uFriendsID] : 0; }
|
||||
|
||||
bool CEntities::IsSettingUpBones() { return m_bSettingUpBones; }
|
||||
@@ -36,23 +36,24 @@ class CEntities
|
||||
std::unordered_map<int, float> m_mSimTimes, m_mOldSimTimes, m_mDeltaTimes;
|
||||
std::unordered_map<int, int> m_mChokes, m_mSetTicks;
|
||||
std::unordered_map<int, std::pair<bool, matrix3x4[MAXSTUDIOBONES]>> m_mBones;
|
||||
std::unordered_map<int, Vec3> m_mEyeAngles, m_mPingAngles;
|
||||
std::unordered_map<int, Vec3> m_mOldAngles, m_mEyeAngles;
|
||||
std::unordered_map<int, bool> m_mLagCompensation;
|
||||
std::unordered_map<int, DormantData> m_mDormancy;
|
||||
std::unordered_map<int, Vec3> m_mAvgVelocities;
|
||||
std::unordered_map<int, uint32_t> m_mModels;
|
||||
std::unordered_map<int, std::deque<VelFixRecord>> m_mOrigins;
|
||||
|
||||
std::unordered_map<int, int> m_mIPriorities;
|
||||
std::unordered_map<uint32_t, int> m_mUPriorities;
|
||||
std::unordered_map<int, bool> m_mIFriends;
|
||||
std::unordered_map<uint32_t, bool> m_mUFriends;
|
||||
std::unordered_map<int, bool> m_mIParty;
|
||||
std::unordered_map<uint32_t, bool> m_mUParty;
|
||||
std::unordered_map<int, uint64_t> m_mIParty;
|
||||
std::unordered_map<uint32_t, uint64_t> m_mUParty;
|
||||
std::unordered_map<int, bool> m_mIF2P;
|
||||
std::unordered_map<uint32_t, bool> m_mUF2P;
|
||||
std::unordered_map<int, int> m_mILevels;
|
||||
std::unordered_map<uint32_t, int> m_mULevels;
|
||||
std::unordered_map<int, int> m_mIPriorities;
|
||||
std::unordered_map<uint32_t, int> m_mUPriorities;
|
||||
uint32_t m_uFriendsID;
|
||||
|
||||
bool m_bSettingUpBones = false;
|
||||
|
||||
@@ -88,6 +89,8 @@ public:
|
||||
uint32_t GetModel(int iIndex);
|
||||
std::deque<VelFixRecord>* GetOrigins(int iIndex);
|
||||
|
||||
int GetPriority(int iIndex);
|
||||
int GetPriority(uint32_t uFriendsID);
|
||||
bool IsFriend(int iIndex);
|
||||
bool IsFriend(uint32_t uFriendsID);
|
||||
bool InParty(int iIndex);
|
||||
@@ -96,8 +99,8 @@ public:
|
||||
bool IsF2P(uint32_t uFriendsID);
|
||||
int GetLevel(int iIndex);
|
||||
int GetLevel(uint32_t uFriendsID);
|
||||
int GetPriority(int iIndex);
|
||||
int GetPriority(uint32_t uFriendsID);
|
||||
uint64_t GetParty(int iIndex);
|
||||
uint64_t GetParty(uint32_t uFriendsID);
|
||||
|
||||
bool IsSettingUpBones();
|
||||
};
|
||||
|
||||
@@ -6,6 +6,8 @@ bool CTraceFilterHitscan::ShouldHitEntity(IHandleEntity* pServerEntity, int nCon
|
||||
{
|
||||
if (!pServerEntity || pServerEntity == pSkip)
|
||||
return false;
|
||||
//if (pServerEntity->GetRefEHandle().GetSerialNumber() == (1 << 15))
|
||||
// return I::ClientEntityList->GetClientEntity(0) != pSkip;
|
||||
|
||||
auto pEntity = reinterpret_cast<CBaseEntity*>(pServerEntity);
|
||||
|
||||
@@ -63,6 +65,8 @@ bool CTraceFilterProjectile::ShouldHitEntity(IHandleEntity* pServerEntity, int n
|
||||
{
|
||||
if (!pServerEntity || pServerEntity == pSkip)
|
||||
return false;
|
||||
//if (pServerEntity->GetRefEHandle().GetSerialNumber() == (1 << 15))
|
||||
// return I::ClientEntityList->GetClientEntity(0) != pSkip;
|
||||
|
||||
auto pEntity = reinterpret_cast<CBaseEntity*>(pServerEntity);
|
||||
|
||||
@@ -113,6 +117,8 @@ bool CTraceFilterWorldAndPropsOnly::ShouldHitEntity(IHandleEntity* pServerEntity
|
||||
{
|
||||
if (!pServerEntity || pServerEntity == pSkip)
|
||||
return false;
|
||||
if (pServerEntity->GetRefEHandle().GetSerialNumber() == (1 << 15))
|
||||
return I::ClientEntityList->GetClientEntity(0) != pSkip;
|
||||
|
||||
auto pEntity = reinterpret_cast<CBaseEntity*>(pServerEntity);
|
||||
|
||||
@@ -137,9 +143,6 @@ bool CTraceFilterWorldAndPropsOnly::ShouldHitEntity(IHandleEntity* pServerEntity
|
||||
}
|
||||
}
|
||||
|
||||
if (pServerEntity->GetRefEHandle().GetSerialNumber() == (1 << 15))
|
||||
return I::ClientEntityList->GetClientEntity(0) != pSkip;
|
||||
|
||||
return false;
|
||||
}
|
||||
TraceType_t CTraceFilterWorldAndPropsOnly::GetTraceType() const
|
||||
|
||||
@@ -764,7 +764,7 @@ void SDK::GetProjectileFireSetup(CTFPlayer* pPlayer, const Vec3& vAngIn, Vec3 vO
|
||||
vAngOut = vAngIn;
|
||||
else
|
||||
{
|
||||
Vec3 vEndPos = vShootPos + (vForward * 2000.f);
|
||||
Vec3 vEndPos = vShootPos + vForward * 2000.f;
|
||||
|
||||
CGameTrace trace = {};
|
||||
CTraceFilterSetup filter = {};
|
||||
|
||||
+982
-778
File diff suppressed because it is too large
Load Diff
@@ -22,9 +22,10 @@ void CConVars::Unload()
|
||||
}
|
||||
}
|
||||
|
||||
ConVar* CConVars::FindVar(const char* cvarname)
|
||||
ConVar* CConVars::FindVar(const char* sCVar)
|
||||
{
|
||||
if (!mCVarMap.contains(FNV1A::Hash32Const(cvarname)))
|
||||
mCVarMap[FNV1A::Hash32Const(cvarname)] = I::CVar->FindVar(cvarname);
|
||||
return mCVarMap[FNV1A::Hash32Const(cvarname)];
|
||||
auto uHash = FNV1A::Hash32(sCVar);
|
||||
if (!mCVarMap.contains(uHash))
|
||||
mCVarMap[uHash] = I::CVar->FindVar(sCVar);
|
||||
return mCVarMap[uHash];
|
||||
}
|
||||
@@ -13,7 +13,7 @@ private:
|
||||
public:
|
||||
void Initialize();
|
||||
void Unload();
|
||||
ConVar* FindVar(const char* cvarname);
|
||||
ConVar* FindVar(const char* sCVar);
|
||||
};
|
||||
|
||||
ADD_FEATURE_CUSTOM(CConVars, ConVars, U);
|
||||
@@ -96,7 +96,8 @@ static LONG APIENTRY ExceptionFilter(PEXCEPTION_POINTERS ExceptionInfo)
|
||||
static bool bException = false;
|
||||
|
||||
if (ExceptionInfo->ExceptionRecord->ExceptionCode != EXCEPTION_ACCESS_VIOLATION
|
||||
|| !ExceptionInfo->ExceptionRecord->ExceptionAddress || mAddresses.contains(ExceptionInfo->ExceptionRecord->ExceptionAddress)
|
||||
/*|| !ExceptionInfo->ExceptionRecord->ExceptionAddress*/
|
||||
|| mAddresses.contains(ExceptionInfo->ExceptionRecord->ExceptionAddress)
|
||||
|| !Vars::Debug::CrashLogging.Value
|
||||
|| bException && GetAsyncKeyState(VK_SHIFT) & 0x8000 && GetAsyncKeyState(VK_RETURN) & 0x8000)
|
||||
return EXCEPTION_EXECUTE_HANDLER;
|
||||
@@ -133,20 +134,22 @@ static LONG APIENTRY ExceptionFilter(PEXCEPTION_POINTERS ExceptionInfo)
|
||||
ssErrorStream << "\n";
|
||||
}
|
||||
|
||||
ssErrorStream << "Ctrl + C to copy. Logged to Amalgam\\crash_log.txt. \n";
|
||||
ssErrorStream << "Built @ " __DATE__ ", " __TIME__;
|
||||
ssErrorStream << "Built @ " __DATE__ ", " __TIME__ "\n";
|
||||
ssErrorStream << "Ctrl + C to copy. \n";
|
||||
if (bException)
|
||||
ssErrorStream << "\nShift + Enter to skip repetitive exceptions. ";
|
||||
ssErrorStream << "Shift + Enter to skip repetitive exceptions. \n";
|
||||
bException = true;
|
||||
try
|
||||
{
|
||||
std::ofstream file;
|
||||
file.open(F::Configs.m_sConfigPath + "crash_log.txt", std::ios_base::app);
|
||||
file << ssErrorStream.str() + "\n\n\n";
|
||||
file.close();
|
||||
ssErrorStream << "Logged to Amalgam\\crash_log.txt. ";
|
||||
}
|
||||
catch (...) {}
|
||||
|
||||
SDK::Output("Unhandled exception", ssErrorStream.str().c_str(), {}, false, true, false, false, false, false, MB_OK | MB_ICONERROR);
|
||||
|
||||
ssErrorStream << "\n\n\n\n";
|
||||
std::ofstream file;
|
||||
file.open(F::Configs.m_sConfigPath + "crash_log.txt", std::ios_base::app);
|
||||
file << ssErrorStream.str();
|
||||
file.close();
|
||||
|
||||
return EXCEPTION_EXECUTE_HANDLER;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user