Fix cathook again™
This commit is contained in:
parent
0365daf550
commit
0a69cb0ca5
@ -23,12 +23,12 @@ public:
|
|||||||
inline static int GetSlot(IClientEntity *self)
|
inline static int GetSlot(IClientEntity *self)
|
||||||
{
|
{
|
||||||
typedef int (*fn_t)(IClientEntity *);
|
typedef int (*fn_t)(IClientEntity *);
|
||||||
return vfunc<fn_t>(self, offsets::PlatformOffset(397, offsets::undefined, 397), 0)(self);
|
return vfunc<fn_t>(self, offsets::PlatformOffset(398, offsets::undefined, 397), 0)(self);
|
||||||
}
|
}
|
||||||
inline static const char *GetPrintName(IClientEntity *self)
|
inline static const char *GetPrintName(IClientEntity *self)
|
||||||
{
|
{
|
||||||
typedef const char *(*fn_t)(IClientEntity *);
|
typedef const char *(*fn_t)(IClientEntity *);
|
||||||
return vfunc<fn_t>(self, offsets::PlatformOffset(400, offsets::undefined, 400), 0)(self);
|
return vfunc<fn_t>(self, offsets::PlatformOffset(401, offsets::undefined, 400), 0)(self);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace re
|
} // namespace re
|
||||||
|
@ -40,47 +40,47 @@ public:
|
|||||||
inline static int GetWeaponID(IClientEntity *self)
|
inline static int GetWeaponID(IClientEntity *self)
|
||||||
{
|
{
|
||||||
typedef int (*fn_t)(IClientEntity *);
|
typedef int (*fn_t)(IClientEntity *);
|
||||||
return vfunc<fn_t>(self, offsets::PlatformOffset(447, offsets::undefined, 447), 0)(self);
|
return vfunc<fn_t>(self, offsets::PlatformOffset(448, offsets::undefined, 448), 0)(self);
|
||||||
}
|
}
|
||||||
inline static bool IsViewModelFlipped(IClientEntity *self)
|
inline static bool IsViewModelFlipped(IClientEntity *self)
|
||||||
{
|
{
|
||||||
typedef bool (*fn_t)(IClientEntity *);
|
typedef bool (*fn_t)(IClientEntity *);
|
||||||
return vfunc<fn_t>(self, offsets::PlatformOffset(496, offsets::undefined, 496), 0)(self);
|
return vfunc<fn_t>(self, offsets::PlatformOffset(497, offsets::undefined, 497), 0)(self);
|
||||||
}
|
}
|
||||||
inline static IClientEntity *GetOwnerViaInterface(IClientEntity *self)
|
inline static IClientEntity *GetOwnerViaInterface(IClientEntity *self)
|
||||||
{
|
{
|
||||||
typedef IClientEntity *(*fn_t)(IClientEntity *);
|
typedef IClientEntity *(*fn_t)(IClientEntity *);
|
||||||
return vfunc<fn_t>(self, offsets::PlatformOffset(454, offsets::undefined, 454), 0)(self);
|
return vfunc<fn_t>(self, offsets::PlatformOffset(455, offsets::undefined, 455), 0)(self);
|
||||||
}
|
}
|
||||||
inline static bool UsesPrimaryAmmo(IClientEntity *self)
|
inline static bool UsesPrimaryAmmo(IClientEntity *self)
|
||||||
{
|
{
|
||||||
typedef bool (*fn_t)(IClientEntity *);
|
typedef bool (*fn_t)(IClientEntity *);
|
||||||
return vfunc<fn_t>(self, offsets::PlatformOffset(450, offsets::undefined, 450), 0)(self);
|
return vfunc<fn_t>(self, offsets::PlatformOffset(451, offsets::undefined, 451), 0)(self);
|
||||||
}
|
}
|
||||||
inline static bool HasPrimaryAmmo(IClientEntity *self)
|
inline static bool HasPrimaryAmmo(IClientEntity *self)
|
||||||
{
|
{
|
||||||
typedef bool (*fn_t)(IClientEntity *);
|
typedef bool (*fn_t)(IClientEntity *);
|
||||||
return vfunc<fn_t>(self, offsets::PlatformOffset(319, offsets::undefined, 319), 0)(self);
|
return vfunc<fn_t>(self, offsets::PlatformOffset(320, offsets::undefined, 320), 0)(self);
|
||||||
}
|
}
|
||||||
inline static bool AreRandomCritsEnabled(IClientEntity *self)
|
inline static bool AreRandomCritsEnabled(IClientEntity *self)
|
||||||
{
|
{
|
||||||
typedef bool (*fn_t)(IClientEntity *);
|
typedef bool (*fn_t)(IClientEntity *);
|
||||||
return vfunc<fn_t>(self, offsets::PlatformOffset(469, offsets::undefined, 469), 0)(self);
|
return vfunc<fn_t>(self, offsets::PlatformOffset(470, offsets::undefined, 470), 0)(self);
|
||||||
}
|
}
|
||||||
inline static bool CalcIsAttackCriticalHelper(IClientEntity *self)
|
inline static bool CalcIsAttackCriticalHelper(IClientEntity *self)
|
||||||
{
|
{
|
||||||
typedef bool (*fn_t)(IClientEntity *);
|
typedef bool (*fn_t)(IClientEntity *);
|
||||||
return vfunc<fn_t>(self, offsets::PlatformOffset(463, offsets::undefined, 463), 0)(self);
|
return vfunc<fn_t>(self, offsets::PlatformOffset(464, offsets::undefined, 464), 0)(self);
|
||||||
}
|
}
|
||||||
inline static bool CalcIsAttackCriticalHelperNoCrits(IClientEntity *self)
|
inline static bool CalcIsAttackCriticalHelperNoCrits(IClientEntity *self)
|
||||||
{
|
{
|
||||||
typedef bool (*fn_t)(IClientEntity *);
|
typedef bool (*fn_t)(IClientEntity *);
|
||||||
return vfunc<fn_t>(self, offsets::PlatformOffset(462, offsets::undefined, 462), 0)(self);
|
return vfunc<fn_t>(self, offsets::PlatformOffset(463, offsets::undefined, 463), 0)(self);
|
||||||
}
|
}
|
||||||
inline static bool CanFireCriticalShot(IClientEntity *self, bool unknown1, IClientEntity *unknown2)
|
inline static bool CanFireCriticalShot(IClientEntity *self, bool unknown1, IClientEntity *unknown2)
|
||||||
{
|
{
|
||||||
typedef bool (*fn_t)(IClientEntity *, bool, IClientEntity *);
|
typedef bool (*fn_t)(IClientEntity *, bool, IClientEntity *);
|
||||||
return vfunc<fn_t>(self, offsets::PlatformOffset(492, offsets::undefined, 492), 0)(self, unknown1, unknown2);
|
return vfunc<fn_t>(self, offsets::PlatformOffset(493, offsets::undefined, 493), 0)(self, unknown1, unknown2);
|
||||||
}
|
}
|
||||||
inline static float ApplyFireDelay(IClientEntity *self, float delay)
|
inline static float ApplyFireDelay(IClientEntity *self, float delay)
|
||||||
{
|
{
|
||||||
|
@ -18,22 +18,22 @@ public:
|
|||||||
inline static float GetProjectileSpeed(IClientEntity *self)
|
inline static float GetProjectileSpeed(IClientEntity *self)
|
||||||
{
|
{
|
||||||
typedef float (*fn_t)(IClientEntity *);
|
typedef float (*fn_t)(IClientEntity *);
|
||||||
return vfunc<fn_t>(self, offsets::PlatformOffset(537, offsets::undefined, 537), 0)(self);
|
return vfunc<fn_t>(self, offsets::PlatformOffset(538, offsets::undefined, 538), 0)(self);
|
||||||
}
|
}
|
||||||
inline static float GetWeaponSpread(IClientEntity *self)
|
inline static float GetWeaponSpread(IClientEntity *self)
|
||||||
{
|
{
|
||||||
typedef float (*fn_t)(IClientEntity *);
|
typedef float (*fn_t)(IClientEntity *);
|
||||||
return vfunc<fn_t>(self, offsets::PlatformOffset(535, offsets::undefined, 535), 0)(self);
|
return vfunc<fn_t>(self, offsets::PlatformOffset(536, offsets::undefined, 536), 0)(self);
|
||||||
}
|
}
|
||||||
inline static float GetProjectileGravity(IClientEntity *self)
|
inline static float GetProjectileGravity(IClientEntity *self)
|
||||||
{
|
{
|
||||||
typedef float (*fn_t)(IClientEntity *);
|
typedef float (*fn_t)(IClientEntity *);
|
||||||
return vfunc<fn_t>(self, offsets::PlatformOffset(538, offsets::undefined, 538), 0)(self);
|
return vfunc<fn_t>(self, offsets::PlatformOffset(539, offsets::undefined, 539), 0)(self);
|
||||||
}
|
}
|
||||||
inline static int LaunchGrenade(IClientEntity *self)
|
inline static int LaunchGrenade(IClientEntity *self)
|
||||||
{
|
{
|
||||||
typedef int (*fn_t)(IClientEntity *);
|
typedef int (*fn_t)(IClientEntity *);
|
||||||
return vfunc<fn_t>(self, offsets::PlatformOffset(551, offsets::undefined, 551), 0)(self);
|
return vfunc<fn_t>(self, offsets::PlatformOffset(552, offsets::undefined, 552), 0)(self);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace re
|
} // namespace re
|
||||||
|
@ -18,7 +18,7 @@ public:
|
|||||||
inline static bool DoSwingTrace(IClientEntity *self, trace_t *trace)
|
inline static bool DoSwingTrace(IClientEntity *self, trace_t *trace)
|
||||||
{
|
{
|
||||||
typedef bool (*fn_t)(IClientEntity *, trace_t *);
|
typedef bool (*fn_t)(IClientEntity *, trace_t *);
|
||||||
return vfunc<fn_t>(self, offsets::PlatformOffset(525, offsets::undefined, 525), 0)(self, trace);
|
return vfunc<fn_t>(self, offsets::PlatformOffset(526, offsets::undefined, 526), 0)(self, trace);
|
||||||
}
|
}
|
||||||
inline static int GetSwingRange(IClientEntity *self)
|
inline static int GetSwingRange(IClientEntity *self)
|
||||||
{
|
{
|
||||||
@ -36,7 +36,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
typedef int (*fn_t)(IClientEntity *);
|
typedef int (*fn_t)(IClientEntity *);
|
||||||
int return_value = vfunc<fn_t>(self, offsets::PlatformOffset(523, offsets::undefined, 523), 0)(self);
|
int return_value = vfunc<fn_t>(self, offsets::PlatformOffset(524, offsets::undefined, 524), 0)(self);
|
||||||
|
|
||||||
if (add_charging)
|
if (add_charging)
|
||||||
{
|
{
|
||||||
|
@ -37,7 +37,7 @@ void ApplySwingHook()
|
|||||||
if (!inited)
|
if (!inited)
|
||||||
{
|
{
|
||||||
inited = true;
|
inited = true;
|
||||||
melee_range_hook.Init((uintptr_t) vfunc<GetSwingRange_o>(RAW_ENT(LOCAL_W), offsets::PlatformOffset(521, offsets::undefined, 521), 0), (void *) GetSwingRange_hook);
|
melee_range_hook.Init((uintptr_t) vfunc<GetSwingRange_o>(RAW_ENT(LOCAL_W), offsets::PlatformOffset(522, offsets::undefined, 522), 0), (void *) GetSwingRange_hook);
|
||||||
}
|
}
|
||||||
melee_range_hook.RestorePatch();
|
melee_range_hook.RestorePatch();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user