-
Автор темы
- #1
C_BaseCombatWeapon got its shit rearranged and lost quite some vfuncs:
WeaponInfo_t struct updated
LoadFromBuffer sig
maybe fix for autowall
Код:
float GetSpread() { return get_vfunc<float(__thiscall*)(void*)>(this, 439)(this); }
WeaponInfo_t* GetWeaponData() { return get_vfunc<WeaponInfo_t*(__thiscall*)(void*)>(this, 446)(this); }
float GetInaccuracy() { return get_vfunc<float(__thiscall*)(void*)>(this, 469)(this); }
void UpdateAccuracyPenalty() { get_vfunc<void(__thiscall*)(void*)>(this, 470)(this); }
Код:
class CCSWeaponData
{
public:
virtual ~CCSWeaponData() {};
/*Parse(KeyValues *, char const*)
RefreshDynamicParameters(void)
GetPrimaryClipSize(C_EconItemView const*, int, float)const
GetSecondaryClipSize(C_EconItemView const*, int, float)const
GetDefaultPrimaryClipSize(C_EconItemView const*, int, float)const
GetDefaultSecondaryClipSize(C_EconItemView const*, int, float)const
GetPrimaryReserveAmmoMax(C_EconItemView const*, int, float)const
GetSecondaryReserveAmmoMax(C_EconItemView const*, int, float)const*/
char* m_szWeaponName; //0x0004
char pad_0x0008[0x8]; //0x0008
CCStrike15ItemDefinition* m_pItemDefinition; //0x0010
int m_iMaxClip1; //0x0014
char pad_0x0018[0xC]; //0x0018
int m_iMaxAmmo; //0x0024
char pad_0x0028[0x4]; //0x0028
char* m_szWorldModel; //0x002C
char* m_szViewModel; //0x0030
char* m_szDroppedModel; //0x0034
char pad_0x0038[0x4]; //0x0038
char* N0000054E; //0x003C
char pad_0x0040[0x38]; //0x0040
char* N0000055D; //0x0078
char pad_0x007C[0x4]; //0x007C
char* m_szAmmoType; //0x0080
char pad_0x0084[0x4]; //0x0084
char* m_szLocalizedName; //0x0088
char pad_0x008C[0x3C]; //0x008C
int m_eWeaponType; //0x00C8
int m_iPrice; //0x00CC
char pad_0x00D0[0x4]; //0x00D0
char* m_szAnimationPrefix; //0x00D4
char pad_0x00D8[0x14]; //0x00D8
int m_iDamage; //0x00EC
float m_fArmorRatio; //0x00F0
char pad_0x00F4[0x4]; //0x00F4
float m_fPenetration; //0x00F8
char pad_0x00FC[0x8]; //0x00FC
float m_fRange; //0x0104
float m_fRangeModifier; //0x0108
char pad_0x010C[0x10]; //0x010C
bool m_bHasSilencer; //0x011C
char pad_0x011D[0x10B]; //0x011D
bool m_bHasBurstmode; //0x0228
bool m_bIsRevolver; //0x0229
char pad_0x022A[0x1BE]; //0x022A
};
Код:
Functions::KeyValues_LoadFromBuffer = Utilities::Memory::FindPattern("client.dll", (PBYTE)"\xE8\x00\x00\x00\x00\x80\x7D\xF8\x00\x00\x00\x85\xDB", "x????xxxx??xx");
Код:
bool TraceToExit1(CVector &end, trace_t *enter_trace, CVector start, CVector dir, trace_t *exit_trace)
{
float distance = 0.0f;
while (distance <= 90.0f)
{
distance += 4.0f;
end = start + dir * distance;
auto point_contents = EngineTrace->GetPointContents(end, MASK_SHOT_HULL | CONTENTS_HITBOX, NULL);
if (point_contents & MASK_SHOT_HULL && !(point_contents & CONTENTS_HITBOX))
continue;
auto new_end = end - (dir * 4.0f);
Ray_t ray;
ray.Init(end, new_end);
EngineTrace->TraceRay(ray, MASK_SHOT, 0, exit_trace);
if (exit_trace->startsolid && exit_trace->surface.flags & SURF_HITBOX)
{
ray.Init(end, start);
CTraceFilter filter;
filter.pSkip1 = exit_trace->m_pEnt;
EngineTrace->TraceRay(ray, 0x600400B, &filter, exit_trace);
if ((exit_trace->fraction < 1.0f || exit_trace->allsolid) && !exit_trace->startsolid)
{
end = exit_trace->endpos;
return true;
}
continue;
}
if (!(exit_trace->fraction < 1.0 || exit_trace->allsolid || exit_trace->startsolid) || exit_trace->startsolid)
{
if (exit_trace->m_pEnt)
{
if (enter_trace->m_pEnt && enter_trace->m_pEnt == ClientEntityList->GetClientEntity(0))
return true;
}
continue;
}
if (exit_trace->surface.flags >> 7 & 1 && !(enter_trace->surface.flags >> 7 & 1))
continue;
if (exit_trace->plane.normal.Dot(dir) <= 1.0f)
{
auto fraction = exit_trace->fraction * 4.0f;
end = end - (dir * fraction);
return true;
}
}
return false;
}