CBasePlayer::WantsLagCompensationOnEntity
0x007a91d0 · 532 bytes · __thiscall
_ZNK11CBasePlayer28WantsLagCompensationOnEntityEPK11CBaseEntityPK8CUserCmdPK7CBitVecILi2048EE
Decompiled
undefined (4 params)
/* CBasePlayer::WantsLagCompensationOnEntity(CBaseEntity const*, CUserCmd const*, CBitVec<2048>
const*) const */
bool __thiscall
CBasePlayer::WantsLagCompensationOnEntity
(CBasePlayer *this,CBaseEntity *param_1,CUserCmd *param_2,CBitVec *param_3)
{
float fVar1;
char cVar2;
bool bVar3;
int iVar4;
uint uVar5;
CBaseEntity *pCVar6;
int iVar7;
uint uVar8;
float local_34;
float local_30;
float local_2c;
float local_28;
float local_24;
float local_20;
if (*(int *)(friendlyfire._28_4_ + 0x30) == 0) {
iVar7 = CBaseEntity::GetTeamNumber(param_1);
iVar4 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
if (iVar7 == iVar4) {
return false;
}
}
if (param_3 != (CBitVec *)0x0) {
if (*(int *)(param_1 + 0x30) == 0) {
uVar8 = 1;
iVar7 = 0;
}
else {
uVar5 = *(int *)(param_1 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
uVar8 = 1 << ((byte)uVar5 & 0x1f);
iVar7 = (uVar5 >> 5) * 4;
}
if ((*(uint *)(param_3 + iVar7) & uVar8) == 0) {
return false;
}
}
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(param_1);
}
cVar2 = (**(code **)(*(int *)param_1 + 0x16c))(param_1);
if (cVar2 == '\0') {
fVar1 = 300.0;
}
else {
cVar2 = (**(code **)(*(int *)param_1 + 0x16c))(param_1);
pCVar6 = (CBaseEntity *)0x0;
if (cVar2 != '\0') {
pCVar6 = param_1;
}
fVar1 = *(float *)(pCVar6 + 0x1ff8);
}
bVar3 = true;
if (*(float *)(sv_maxunlag._28_4_ + 0x2c) * 1.5 * fVar1 <=
SQRT((*(float *)(param_1 + 0x2e4) - *(float *)(this + 0x2e4)) *
(*(float *)(param_1 + 0x2e4) - *(float *)(this + 0x2e4)) +
(*(float *)(param_1 + 0x2e8) - *(float *)(this + 0x2e8)) *
(*(float *)(param_1 + 0x2e8) - *(float *)(this + 0x2e8)) +
(*(float *)(param_1 + 0x2e0) - *(float *)(this + 0x2e0)) *
(*(float *)(param_1 + 0x2e0) - *(float *)(this + 0x2e0)))) {
AngleVectors((QAngle *)(param_2 + 0xc),(Vector *)&local_34);
local_28 = *(float *)(param_1 + 0x2e0) - *(float *)(this + 0x2e0);
local_24 = *(float *)(param_1 + 0x2e4) - *(float *)(this + 0x2e4);
local_20 = *(float *)(param_1 + 0x2e8) - *(float *)(this + 0x2e8);
VectorNormalize((Vector *)&local_28);
bVar3 = 0.707107 <= local_24 * local_30 + local_28 * local_34 + local_20 * local_2c;
}
return bVar3;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.