mirror of
https://github.com/rei-2/Amalgam
synced 2026-10-10 04:43:09 +08:00
force crit effects
fix oversight with IsCritBoosted
This commit is contained in:
@@ -969,6 +969,7 @@
|
||||
<ClCompile Include="src\Hooks\CModelLoader_Map_LoadModel.cpp" />
|
||||
<ClCompile Include="src\Hooks\CM_TraceToDispTree.cpp" />
|
||||
<ClCompile Include="src\Hooks\CTFPlayerShared_ShouldSuppressPrediction.cpp" />
|
||||
<ClCompile Include="src\Hooks\CTFPlayerShared_IsCritBoosted.cpp" />
|
||||
<ClCompile Include="src\Hooks\CTFRocketLauncher_CheckReloadMisfire.cpp" />
|
||||
<ClCompile Include="src\Hooks\CTFPlayer_FireBullet.cpp" />
|
||||
<ClCompile Include="src\Hooks\CBaseEntity_ResetLatched.cpp" />
|
||||
|
||||
@@ -204,6 +204,7 @@
|
||||
<ClCompile Include="include\ImGui\imgui_tables.cpp" />
|
||||
<ClCompile Include="include\ImGui\imgui_widgets.cpp" />
|
||||
<ClCompile Include="include\ImGui\TextEditor.cpp" />
|
||||
<ClCompile Include="src\Hooks\CTFPlayerShared_IsCritBoosted.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\Utils\UtlVector\UtlVector.h" />
|
||||
|
||||
@@ -411,6 +411,19 @@ int CCritHack::PredictCmdNum(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd
|
||||
return iCommandNumber;
|
||||
}
|
||||
|
||||
bool CCritHack::ShouldForceEffects(CTFPlayer* pLocal)
|
||||
{
|
||||
if (!Vars::CritHack::CritEffects.Value || !pLocal->IsAlive() || pLocal->IsAGhost() || pLocal->IsCritBoosted())
|
||||
return false;
|
||||
|
||||
auto pWeapon = H::Entities.GetWeapon();
|
||||
if (!pWeapon || !WeaponCanCrit(pWeapon))
|
||||
return false;
|
||||
|
||||
float flTickBase = TICKS_TO_TIME(pLocal->m_nTickBase());
|
||||
return Vars::CritHack::ForceCrits.Value && !m_bCritBanned && m_iAvailableCrits > 0 || pWeapon->m_flCritTime() > flTickBase;
|
||||
}
|
||||
|
||||
void CCritHack::Event(IGameEvent* pEvent, uint32_t uHash, CTFPlayer* pLocal)
|
||||
{
|
||||
switch (uHash)
|
||||
@@ -595,8 +608,7 @@ void CCritHack::Draw(CTFPlayer* pLocal)
|
||||
return;
|
||||
|
||||
auto pWeapon = H::Entities.GetWeapon();
|
||||
if (!pWeapon || !pLocal->IsAlive() || pLocal->IsAGhost()
|
||||
|| !WeaponCanCrit(pWeapon, true))
|
||||
if (!pWeapon || !pLocal->IsAlive() || pLocal->IsAGhost() || !WeaponCanCrit(pWeapon, true))
|
||||
return;
|
||||
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ public:
|
||||
|
||||
bool WeaponCanCrit(CTFWeaponBase* pWeapon, bool bWeaponOnly = false);
|
||||
int PredictCmdNum(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pCmd);
|
||||
bool ShouldForceEffects(CTFPlayer* pLocal);
|
||||
|
||||
float GetCritDamage() { return m_iCritDamage; }
|
||||
float GetRangedDamage() { return m_iRangedDamage; }
|
||||
|
||||
@@ -203,7 +203,8 @@ void CMenu::MenuAimbot(int iTab)
|
||||
{
|
||||
FToggle(Vars::CritHack::ForceCrits, FToggleEnum::Left);
|
||||
FToggle(Vars::CritHack::AvoidRandomCrits, FToggleEnum::Right);
|
||||
FToggle(Vars::CritHack::AlwaysMeleeCrit);
|
||||
FToggle(Vars::CritHack::AlwaysMeleeCrit, FToggleEnum::Left);
|
||||
FToggle(Vars::CritHack::CritEffects, FToggleEnum::Right);
|
||||
} EndSection();
|
||||
if (Vars::Debug::Options.Value)
|
||||
{
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
#include "Visuals.h"
|
||||
|
||||
#include "../Aimbot/Aimbot.h"
|
||||
#include "../Aimbot/AimbotProjectile/AimbotProjectile.h"
|
||||
#include "../Ticks/Ticks.h"
|
||||
#include "../Backtrack/Backtrack.h"
|
||||
#include "../Simulation/ProjectileSimulation/ProjectileSimulation.h"
|
||||
#include "../Aimbot/AimbotProjectile/AimbotProjectile.h"
|
||||
#include "../Aimbot/Aimbot.h"
|
||||
#include "CameraWindow/CameraWindow.h"
|
||||
#include "../Players/PlayerUtils.h"
|
||||
#include "../Spectate/Spectate.h"
|
||||
#include "Groups/Groups.h"
|
||||
#include "../Backtrack/Backtrack.h"
|
||||
#include "../Spectate/Spectate.h"
|
||||
#include "../CritHack/CritHack.h"
|
||||
#include "../Ticks/Ticks.h"
|
||||
#include "../World/World.h"
|
||||
|
||||
MAKE_SIGNATURE(UTIL_PlayerByIndex, "server.dll", "48 83 EC ? 8B D1 85 C9 7E ? 48 8B 05", 0x0);
|
||||
MAKE_SIGNATURE(CBaseAnimating_DrawServerHitboxes, "server.dll", "44 88 44 24 ? 53 48 81 EC", 0x0);
|
||||
MAKE_SIGNATURE(NDebugOverlay_BoxAngles, "server.dll", "48 83 EC ? 4C 8B D9 48 8B 0D ? ? ? ? 48 85 C9 74 ? 8B 84 24 ? ? ? ? F3 0F 10 84 24 ? ? ? ? 4C 8B 11 F3 0F 11 44 24 ? 89 44 24 ? 8B 84 24 ? ? ? ? 89 44 24 ? 8B 84 24 ? ? ? ? 89 44 24 ? 8B 84 24 ? ? ? ? 89 44 24 ? 4C 89 4C 24", 0x0);
|
||||
MAKE_SIGNATURE(CBaseAnimating_DrawServerHitboxes_BoxAngles_Call, "server.dll", "8B 84 24 ? ? ? ? 49 83 C6", 0x0);
|
||||
MAKE_SIGNATURE(CTFPlayerShared_UpdateCritBoostEffect, "client.dll", "48 8B C4 48 89 58 ? 48 89 70 ? 48 89 78 ? 41 56 48 81 EC ? ? ? ? 48 89 68", 0x0);
|
||||
|
||||
enum ECritBoostUpdateType { kCritBoost_Ignore, kCritBoost_ForceRefresh };
|
||||
|
||||
static std::vector<Vec3> SplashTrace(Vec3 vOrigin, float flRadius, Vec3 vNormal = { 0, 0, 1 }, bool bTrace = true, int iSegments = 100)
|
||||
{
|
||||
@@ -1159,12 +1162,20 @@ void CVisuals::CreateMove(CTFPlayer* pLocal, CTFWeaponBase* pWeapon)
|
||||
}
|
||||
}
|
||||
|
||||
if (Vars::Visuals::Effects::SpellFootsteps.Value && (F::Ticks.m_bDoubletap || F::Ticks.m_bWarp))
|
||||
pLocal->FireEvent(pLocal->GetAbsOrigin(), QAngle(), 7001, nullptr);
|
||||
bool bEffects = F::CritHack.ShouldForceEffects(pLocal);
|
||||
if (!bEffects && !pLocal->IsCritBoosted() && pLocal->m_pCritBoostSoundLoop())
|
||||
S::CTFPlayerShared_UpdateCritBoostEffect.Call<void>(pLocal->m_Shared(), kCritBoost_Ignore);
|
||||
else if (bEffects && !pLocal->m_pCritBoostSoundLoop())
|
||||
{
|
||||
int iOriginalCond = pLocal->m_nPlayerCondEx();
|
||||
pLocal->AddCond(TF_COND_CRITBOOSTED_USER_BUFF);
|
||||
S::CTFPlayerShared_UpdateCritBoostEffect.Call<void>(pLocal->m_Shared(), kCritBoost_Ignore);
|
||||
pLocal->m_nPlayerCondEx() = iOriginalCond;
|
||||
}
|
||||
|
||||
static uint32_t iOldMedigunBeam = 0, iOldMedigunCharge = 0;
|
||||
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)
|
||||
static uint32_t uOldHashBeam = 0, uOldHashCharge = 0;
|
||||
auto uHashBeam = FNV1A::Hash32(Vars::Visuals::Effects::MedigunBeam.Value.c_str()), uHashCharge = FNV1A::Hash32(Vars::Visuals::Effects::MedigunCharge.Value.c_str());
|
||||
if (uOldHashBeam != uHashBeam || uOldHashCharge != uHashCharge)
|
||||
{
|
||||
if (pWeapon && pWeapon->GetWeaponID() == TF_WEAPON_MEDIGUN)
|
||||
{
|
||||
@@ -1174,16 +1185,17 @@ void CVisuals::CreateMove(CTFPlayer* pLocal, CTFWeaponBase* pWeapon)
|
||||
pMedigun->ManageChargeEffect();
|
||||
}
|
||||
|
||||
iOldMedigunBeam = iNewMedigunBeam;
|
||||
iOldMedigunCharge = iNewMedigunCharge;
|
||||
uOldHashBeam = uHashBeam, uOldHashCharge = uHashCharge;
|
||||
}
|
||||
|
||||
if (Vars::Visuals::Effects::SpellFootsteps.Value && (F::Ticks.m_bDoubletap || F::Ticks.m_bWarp))
|
||||
pLocal->FireEvent(pLocal->GetAbsOrigin(), QAngle(), 7001, nullptr);
|
||||
|
||||
static auto r_aspectratio = H::ConVars.FindVar("r_aspectratio");
|
||||
static float flStaticRatio = 0.f;
|
||||
float flOldRatio = flStaticRatio;
|
||||
float flNewRatio = flStaticRatio = Vars::Visuals::UI::AspectRatio.Value;
|
||||
static float flOldRatio = 0.f;
|
||||
float flNewRatio = Vars::Visuals::UI::AspectRatio.Value;
|
||||
if (flNewRatio != flOldRatio)
|
||||
r_aspectratio->SetValue(flNewRatio);
|
||||
r_aspectratio->SetValue(flOldRatio = flNewRatio);
|
||||
|
||||
DrawHitboxes(2);
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ MAKE_HOOK(CBasePlayer_ItemPostFrame, S::CBasePlayer_ItemPostFrame(), void,
|
||||
if (!pViewmodel)
|
||||
return CALL_ORIGINAL(rcx);
|
||||
|
||||
auto pStudio = pViewmodel->GetModelPtr();
|
||||
auto pStudio = pViewmodel->m_pStudioHdr();
|
||||
if (!pStudio)
|
||||
return CALL_ORIGINAL(rcx);
|
||||
|
||||
|
||||
@@ -21,13 +21,8 @@ MAKE_HOOK(CTFPlayerShared_InCond, S::CTFPlayerShared_InCond(), bool,
|
||||
const auto dwKart1 = S::CTFPlayer_CreateMove_InCondKart_Call();
|
||||
const auto dwKart2 = S::CTFInput_ApplyMouse_InCond_Call();
|
||||
|
||||
auto fGetOuter = [&rcx]() -> CBaseEntity*
|
||||
{
|
||||
static const auto iShared = U::NetVars.GetNetVar("CTFPlayer", "m_Shared");
|
||||
static const auto iBombHeadStage = U::NetVars.GetNetVar("CTFPlayer", "m_nHalloweenBombHeadStage");
|
||||
static const auto iOffset = iBombHeadStage - iShared + 0x4;
|
||||
return *reinterpret_cast<CBaseEntity**>(uintptr_t(rcx) + iOffset);
|
||||
};
|
||||
auto pLocal = H::Entities.GetLocal();
|
||||
auto pShared = pLocal ? pLocal->m_Shared() : nullptr;
|
||||
|
||||
switch (nCond)
|
||||
{
|
||||
@@ -36,13 +31,13 @@ MAKE_HOOK(CTFPlayerShared_InCond, S::CTFPlayerShared_InCond(), bool,
|
||||
return false;
|
||||
break;
|
||||
case TF_COND_DISGUISED:
|
||||
if (Vars::Visuals::Removals::Disguises.Value && H::Entities.GetLocal() != fGetOuter())
|
||||
if (Vars::Visuals::Removals::Disguises.Value && pShared != rcx)
|
||||
return false;
|
||||
break;
|
||||
case TF_COND_TAUNTING:
|
||||
if (dwRetAddr == dwTaunt && Vars::Misc::Automation::TauntControl.Value)
|
||||
return false;
|
||||
if (Vars::Visuals::Removals::Taunts.Value && H::Entities.GetLocal() != fGetOuter())
|
||||
if (Vars::Visuals::Removals::Taunts.Value && pShared != rcx)
|
||||
return false;
|
||||
break;
|
||||
case TF_COND_HALLOWEEN_KART:
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#include "../SDK/SDK.h"
|
||||
|
||||
#include "../Features/CritHack/CritHack.h"
|
||||
|
||||
MAKE_SIGNATURE(CTFPlayerShared_IsCritBoosted, "client.dll", "48 89 5C 24 ? 57 48 83 EC ? 48 8B D9 0F 29 7C 24", 0x0);
|
||||
MAKE_SIGNATURE(CProxyModelGlowColor_OnBind_IsCritBoosted_Call, "client.dll", "48 8B CF 84 C0 74 ? BA", 0x0);
|
||||
|
||||
MAKE_HOOK(CTFPlayerShared_IsCritBoosted, S::CTFPlayerShared_IsCritBoosted(), bool,
|
||||
void* rcx)
|
||||
{
|
||||
DEBUG_RETURN(CTFPlayerShared_UpdateCritBoostEffect, rcx);
|
||||
|
||||
const auto dwRetAddr = uintptr_t(_ReturnAddress());
|
||||
const auto dwDesired = S::CProxyModelGlowColor_OnBind_IsCritBoosted_Call();
|
||||
|
||||
if (dwRetAddr != dwDesired)
|
||||
return CALL_ORIGINAL(rcx);
|
||||
|
||||
auto pLocal = H::Entities.GetLocal();
|
||||
if (!pLocal || pLocal->m_Shared() != rcx || !F::CritHack.ShouldForceEffects(pLocal))
|
||||
return CALL_ORIGINAL(rcx);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1798,6 +1798,27 @@ enum ETFWeaponType
|
||||
TF_WEAPON_FLAME_BALL
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
TF_WPN_TYPE_PRIMARY = 0,
|
||||
TF_WPN_TYPE_SECONDARY,
|
||||
TF_WPN_TYPE_MELEE,
|
||||
TF_WPN_TYPE_GRENADE,
|
||||
TF_WPN_TYPE_BUILDING,
|
||||
TF_WPN_TYPE_PDA,
|
||||
TF_WPN_TYPE_ITEM1,
|
||||
TF_WPN_TYPE_ITEM2,
|
||||
TF_WPN_TYPE_HEAD,
|
||||
TF_WPN_TYPE_MISC,
|
||||
TF_WPN_TYPE_MELEE_ALLCLASS,
|
||||
TF_WPN_TYPE_SECONDARY2,
|
||||
TF_WPN_TYPE_PRIMARY2,
|
||||
TF_WPN_TYPE_ITEM3,
|
||||
TF_WPN_TYPE_ITEM4,
|
||||
TF_WPM_TYPE_PASSTIME_BALL,
|
||||
TF_WPN_TYPE_COUNT,
|
||||
};
|
||||
|
||||
enum ETFWeapons
|
||||
{
|
||||
Scout_m_Scattergun = 13,
|
||||
|
||||
@@ -37,9 +37,9 @@ public:
|
||||
return *reinterpret_cast<std::array<float, 24>*>(uintptr_t(this) + nOffset);
|
||||
}
|
||||
|
||||
NETVAR_OFF(GetModelPtr, CStudioHdr*, "CBaseAnimating", "m_nMuzzleFlashParity", 16);
|
||||
NETVAR_OFF(m_bSequenceLoops, bool, "CBaseAnimating", "m_flFadeScale", 13);
|
||||
NETVAR_OFF(m_pStudioHdr, CStudioHdr*, "CBaseAnimating", "m_nMuzzleFlashParity", 16);
|
||||
NETVAR_OFF(m_CachedBoneData, CUtlVector<matrix3x4>, "CBaseAnimating", "m_hLightingOrigin", -88);
|
||||
NETVAR_OFF(m_bSequenceLoops, bool, "CBaseAnimating", "m_flFadeScale", 13);
|
||||
|
||||
VIRTUAL_ARGS(GetAttachment, bool, 71, (int number, Vec3& origin), this, number, std::ref(origin))
|
||||
VIRTUAL_ARGS(FireEvent, void, 175, (const Vector& origin, const QAngle& angles, int event, const char* options), this, std::ref(origin), std::ref(angles), event, options);
|
||||
|
||||
@@ -19,9 +19,9 @@ public:
|
||||
NETVAR(m_iState, int, "CBaseCombatWeapon", "m_iState");
|
||||
NETVAR(m_hOwner, EHANDLE, "CBaseCombatWeapon", "m_hOwner");
|
||||
|
||||
NETVAR_OFF(m_bReloadsSingly, bool, "CBaseCombatWeapon", "m_iClip2", 24);
|
||||
NETVAR_OFF(m_bInReload, bool, "CBaseCombatWeapon", "m_flTimeWeaponIdle", 4);
|
||||
NETVAR_OFF(m_bRemoveable, bool, "CBaseCombatWeapon", "m_iState", -12);
|
||||
NETVAR_OFF(m_bReloadsSingly, bool, "CBaseCombatWeapon", "m_iClip2", 24);
|
||||
|
||||
VIRTUAL(CanBeSelected, bool, 233, this);
|
||||
VIRTUAL(CheckReload, void, 278, this);
|
||||
|
||||
@@ -92,13 +92,13 @@ public:
|
||||
NETVAR(movetype, int, "CBaseEntity", "movetype");
|
||||
|
||||
NETVAR_OFF(m_flOldSimulationTime, float, "CBaseEntity", "m_flSimulationTime", 4);
|
||||
NETVAR_OFF_EMBED(m_Particles, CParticleProperty*, "CBaseEntity", "m_flElasticity", -56);
|
||||
NETVAR_OFF(m_iv_angRotation, CInterpolatedVar<Vec3>, "CBaseEntity", "m_vecOrigin", -128);
|
||||
NETVAR_OFF(m_iv_vecVelocity, CInterpolatedVar<Vec3>, "CBaseEntity", "m_iTeamNum", 156);
|
||||
NETVAR_OFF(m_iv_vecOrigin, CInterpolatedVar<Vec3>, "CBaseEntity", "m_flShadowCastDistance", 84);
|
||||
NETVAR_OFF(m_MoveType, byte, "CTFPlayer", "m_nWaterLevel", -4);
|
||||
NETVAR_OFF(m_MoveCollide, byte, "CTFPlayer", "m_nWaterLevel", -3);
|
||||
NETVAR_OFF(m_nWaterType, byte, "CTFPlayer", "m_nWaterLevel", 1);
|
||||
NETVAR_OFF_EMBED(m_Particles, CParticleProperty*, "CBaseEntity", "m_flElasticity", -56);
|
||||
NETVAR_OFF(m_iv_vecVelocity, CInterpolatedVar<Vec3>, "CBaseEntity", "m_iTeamNum", 156);
|
||||
NETVAR_OFF(m_iv_vecOrigin, CInterpolatedVar<Vec3>, "CBaseEntity", "m_flShadowCastDistance", 84);
|
||||
NETVAR_OFF(m_iv_angRotation, CInterpolatedVar<Vec3>, "CBaseEntity", "m_vecOrigin", -128);
|
||||
inline CBaseEntity* GetMoveParent()
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CBaseEntity", "moveparent") - 8;
|
||||
|
||||
@@ -67,14 +67,14 @@ public:
|
||||
NETVAR(m_hViewModel, EHANDLE, "CBasePlayer", "m_hViewModel[0]");
|
||||
NETVAR(m_szLastPlaceName, const char*, "CBasePlayer", "m_szLastPlaceName");
|
||||
|
||||
NETVAR_OFF(m_flWaterJumpTime, float, "CBasePlayer", "m_fOnTarget", -60);
|
||||
NETVAR_OFF(m_flSwimSoundTime, float, "CBasePlayer", "m_fOnTarget", -44);
|
||||
NETVAR_OFF(m_vecLadderNormal, Vec3, "CBasePlayer", "m_fOnTarget", -36);
|
||||
NETVAR_OFF(m_flPhysics, int, "CBasePlayer", "m_nTickBase", -4);
|
||||
NETVAR_OFF(m_nFinalPredictedTick, int, "CBasePlayer", "m_nTickBase", 4);
|
||||
NETVAR_OFF(m_nButtons, int, "CBasePlayer", "m_hConstraintEntity", -12);
|
||||
NETVAR_OFF(m_pCurrentCommand, CUserCmd*, "CBasePlayer", "m_hConstraintEntity", -8);
|
||||
NETVAR_OFF(m_afButtonLast, int, "CBasePlayer", "m_hConstraintEntity", -24);
|
||||
NETVAR_OFF(m_flWaterJumpTime, float, "CBasePlayer", "m_fOnTarget", -60);
|
||||
NETVAR_OFF(m_flSwimSoundTime, float, "CBasePlayer", "m_fOnTarget", -44);
|
||||
NETVAR_OFF(m_vecLadderNormal, Vec3, "CBasePlayer", "m_fOnTarget", -36);
|
||||
NETVAR_OFF(m_surfaceProps, int, "CBasePlayer", "m_szLastPlaceName", 20);
|
||||
NETVAR_OFF(m_pSurfaceData, void*, "CBasePlayer", "m_szLastPlaceName", 24);
|
||||
NETVAR_OFF(m_surfaceFriction, float, "CBasePlayer", "m_szLastPlaceName", 32);
|
||||
|
||||
@@ -110,16 +110,29 @@ bool CTFPlayer::IsUbered()
|
||||
|
||||
bool CTFPlayer::IsCritBoosted()
|
||||
{
|
||||
return InCond(TF_COND_CRITBOOSTED)
|
||||
if (InCond(TF_COND_CRITBOOSTED)
|
||||
|| InCond(TF_COND_CRITBOOSTED_PUMPKIN)
|
||||
|| InCond(TF_COND_CRITBOOSTED_USER_BUFF)
|
||||
|| InCond(TF_COND_CRITBOOSTED_FIRST_BLOOD)
|
||||
|| InCond(TF_COND_CRITBOOSTED_BONUS_TIME)
|
||||
|| InCond(TF_COND_CRITBOOSTED_CTF_CAPTURE)
|
||||
|| InCond(TF_COND_CRITBOOSTED_ON_KILL)
|
||||
|| InCond(TF_COND_CRITBOOSTED_RAGE_BUFF)
|
||||
|| InCond(TF_COND_CRITBOOSTED_CARD_EFFECT)
|
||||
|| InCond(TF_COND_CRITBOOSTED_RUNE_TEMP);
|
||||
|| InCond(TF_COND_CRITBOOSTED_RUNE_TEMP))
|
||||
return true;
|
||||
|
||||
auto pWeapon = m_hActiveWeapon()->As<CTFWeaponBase>();
|
||||
if (!pWeapon)
|
||||
return false;
|
||||
|
||||
auto pWeaponInfo = pWeapon->m_pWeaponInfo();
|
||||
if (!pWeaponInfo)
|
||||
return false;
|
||||
|
||||
if (InCond(TF_COND_CRITBOOSTED_RAGE_BUFF) && pWeaponInfo->m_iWeaponType == TF_WPN_TYPE_PRIMARY)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CTFPlayer::IsMiniCritBoosted()
|
||||
|
||||
@@ -187,16 +187,18 @@ public:
|
||||
NETVAR(m_bRegenerating, bool, "CTFPlayer", "m_bRegenerating");
|
||||
NETVAR(m_hOffHandWeapon, EHANDLE, "CTFPlayer", "m_hOffHandWeapon");
|
||||
|
||||
NETVAR_OFF(m_flTankPressure, float, "CTFPlayer", "m_Shared", 636);
|
||||
NETVAR_OFF(m_flInvisibility, float, "CTFPlayer", "m_flInvisChangeCompleteTime", -8);
|
||||
NETVAR_OFF(m_flPrevInvisibility, float, "CTFPlayer", "m_flInvisChangeCompleteTime", -4);
|
||||
NETVAR_OFF(m_flTankPressure, float, "CTFPlayer", "m_Shared", 636);
|
||||
NETVAR_OFF(m_pCritBoostSoundLoop, void*, "CTFPlayer", "m_flSpyTranqBuffDuration", 12);
|
||||
NETVAR_OFF(m_bScattergunJump, bool, "CTFPlayer", "m_flSpyTranqBuffDuration", 20);
|
||||
NETVAR_OFF(m_PlayerAnimState, CTFPlayerAnimState*, "CTFPlayer", "m_hItem", -88);
|
||||
NETVAR_OFF(m_flPrevTauntYaw, float, "CTFPlayer", "m_flTauntYaw", 4);
|
||||
NETVAR_OFF(m_flLastMovementStunChange, float, "CTFPlayer", "m_hItem", -180);
|
||||
NETVAR_OFF(m_flStunLerpTarget, float, "CTFPlayer", "m_hItem", -184);
|
||||
NETVAR_OFF(m_bStunNeedsFadeOut, bool, "CTFPlayer", "m_hItem", -188);
|
||||
NETVAR_OFF(m_bTauntForceMoveForward, bool, "CTFPlayer", "m_bAllowMoveDuringTaunt", 1);
|
||||
NETVAR_OFF(m_flTauntForceMoveForwardSpeed, float, "CTFPlayer", "m_bAllowMoveDuringTaunt", 4);
|
||||
NETVAR_OFF(m_flPrevTauntYaw, float, "CTFPlayer", "m_flTauntYaw", 4);
|
||||
|
||||
VIRTUAL(GetMaxHealth, int, 107, this);
|
||||
VIRTUAL(ThirdPersonSwitch, void, 256, this);
|
||||
|
||||
@@ -66,7 +66,7 @@ bool CTFWeaponBase::IsInReload()
|
||||
|
||||
float CTFWeaponBase::GetDamage(bool bAttribHookValue)
|
||||
{
|
||||
if (auto pWeaponInfo = GetWeaponInfo())
|
||||
if (auto pWeaponInfo = m_pWeaponInfo())
|
||||
{
|
||||
if (!bAttribHookValue)
|
||||
#ifdef WEAPONDATA_USES_WEAPONMODE
|
||||
@@ -82,7 +82,7 @@ float CTFWeaponBase::GetDamage(bool bAttribHookValue)
|
||||
|
||||
float CTFWeaponBase::GetFireRate(bool bAttribHookValue)
|
||||
{
|
||||
if (auto pWeaponInfo = GetWeaponInfo())
|
||||
if (auto pWeaponInfo = m_pWeaponInfo())
|
||||
{
|
||||
if (!bAttribHookValue)
|
||||
#ifdef WEAPONDATA_USES_WEAPONMODE
|
||||
@@ -98,7 +98,7 @@ float CTFWeaponBase::GetFireRate(bool bAttribHookValue)
|
||||
|
||||
int CTFWeaponBase::GetBulletsPerShot(bool bAttribHookValue)
|
||||
{
|
||||
if (auto pWeaponInfo = GetWeaponInfo())
|
||||
if (auto pWeaponInfo = m_pWeaponInfo())
|
||||
{
|
||||
if (!bAttribHookValue)
|
||||
#ifdef WEAPONDATA_USES_WEAPONMODE
|
||||
@@ -114,7 +114,7 @@ int CTFWeaponBase::GetBulletsPerShot(bool bAttribHookValue)
|
||||
|
||||
int CTFWeaponBase::GetAmmoPerShot(bool bAttribHookValue)
|
||||
{
|
||||
if (auto pWeaponInfo = GetWeaponInfo())
|
||||
if (auto pWeaponInfo = m_pWeaponInfo())
|
||||
{
|
||||
if (!bAttribHookValue)
|
||||
#ifdef WEAPONDATA_USES_WEAPONMODE
|
||||
@@ -132,29 +132,29 @@ int CTFWeaponBase::GetAmmoPerShot(bool bAttribHookValue)
|
||||
|
||||
bool CTFWeaponBase::IsRapidFire()
|
||||
{
|
||||
if (auto pWeaponInfo = GetWeaponInfo())
|
||||
if (auto pWeaponInfo = m_pWeaponInfo())
|
||||
#ifdef WEAPONDATA_USES_WEAPONMODE
|
||||
return pWeaponInfo->GetWeaponData(m_iWeaponMode()).m_bUseRapidFireCrits;
|
||||
#else
|
||||
return pWeaponInfo->GetWeaponData(TF_WEAPON_PRIMARY_MODE).m_bUseRapidFireCrits;
|
||||
#endif
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
float CTFWeaponBase::GetSmackDelay()
|
||||
{
|
||||
if (auto pWeaponInfo = GetWeaponInfo())
|
||||
if (auto pWeaponInfo = m_pWeaponInfo())
|
||||
#ifdef WEAPONDATA_USES_WEAPONMODE
|
||||
return pWeaponInfo->GetWeaponData(m_iWeaponMode()).m_flSmackDelay;
|
||||
#else
|
||||
return pWeaponInfo->GetWeaponData(TF_WEAPON_PRIMARY_MODE).m_flSmackDelay;
|
||||
#endif
|
||||
return 0.2f;
|
||||
return 0.2f;
|
||||
}
|
||||
|
||||
float CTFWeaponBase::GetRange()
|
||||
{
|
||||
if (auto pWeaponInfo = GetWeaponInfo())
|
||||
if (auto pWeaponInfo = m_pWeaponInfo())
|
||||
#ifdef WEAPONDATA_USES_WEAPONMODE
|
||||
return pWeaponInfo->GetWeaponData(m_iWeaponMode()).m_flRange;
|
||||
#else
|
||||
|
||||
@@ -190,8 +190,6 @@ public:
|
||||
NETVAR(m_nInspectStage, int, "CTFWeaponBase", "m_nInspectStage");
|
||||
NETVAR(m_iConsecutiveShots, int, "CTFWeaponBase", "m_iConsecutiveShots");
|
||||
|
||||
NETVAR_OFF(GetWeaponInfo, CTFWeaponInfo*, "CTFWeaponBase", "m_flEffectBarRegenTime", 16);
|
||||
NETVAR_OFF(m_flSmackTime, float, "CTFWeaponBase", "m_nInspectStage", 28);
|
||||
NETVAR_OFF(m_flCritTokenBucket, float, "CTFWeaponBase", "m_iReloadMode", -244);
|
||||
NETVAR_OFF(m_nCritChecks, int, "CTFWeaponBase", "m_iReloadMode", -240);
|
||||
NETVAR_OFF(m_nCritSeedRequests, int, "CTFWeaponBase", "m_iReloadMode", -236);
|
||||
@@ -199,6 +197,8 @@ public:
|
||||
NETVAR_OFF(m_flCritTime, float, "CTFWeaponBase", "m_flLastCritCheckTime", -4);
|
||||
NETVAR_OFF(m_iCurrentSeed, int, "CTFWeaponBase", "m_flLastCritCheckTime", 8);
|
||||
NETVAR_OFF(m_flLastRapidFireCritCheckTime, float, "CTFWeaponBase", "m_flLastCritCheckTime", 12);
|
||||
NETVAR_OFF(m_pWeaponInfo, CTFWeaponInfo*, "CTFWeaponBase", "m_flReloadPriorNextFire", 4);
|
||||
NETVAR_OFF(m_flSmackTime, float, "CTFWeaponBase", "m_nInspectStage", 28);
|
||||
inline void* m_pMeter()
|
||||
{
|
||||
static int nOffset = U::NetVars.GetNetVar("CTFWeaponBase", "m_flEffectBarRegenTime") + -40;
|
||||
|
||||
@@ -422,6 +422,7 @@ NAMESPACE_BEGIN(Vars)
|
||||
CVar(ForceCrits, "Force crits", false);
|
||||
CVar(AvoidRandomCrits, "Avoid random crits", false);
|
||||
CVar(AlwaysMeleeCrit, "Always melee crit", false);
|
||||
CVar(CritEffects, "Crit effects", false);
|
||||
NAMESPACE_END(CritHack)
|
||||
|
||||
NAMESPACE_BEGIN(Backtrack)
|
||||
|
||||
Reference in New Issue
Block a user