CBasePlayer::CalcPlayerView
0x004193f0 · 353 bytes · __thiscall
_ZN11CBasePlayer14CalcPlayerViewER6VectorR6QAngleRf
Decompiled
undefined (4 params)
/* CBasePlayer::CalcPlayerView(Vector&, QAngle&, float&) */
void __thiscall
CBasePlayer::CalcPlayerView(CBasePlayer *this,Vector *param_1,QAngle *param_2,float *param_3)
{
float fVar1;
float fVar2;
float fVar3;
float fVar4;
char cVar5;
undefined4 *puVar6;
int iVar7;
float *pfVar8;
float local_28;
float local_24;
float local_20;
cVar5 = IsHeadTrackingEnabled();
if (cVar5 == '\0') {
(**(code **)(*(int *)this + 0x234))();
*(float *)param_1 = local_28;
*(float *)(param_1 + 4) = local_24;
*(float *)(param_1 + 8) = local_20;
puVar6 = (undefined4 *)(**(code **)(*(int *)this + 0x238))(this);
*(undefined4 *)param_2 = *puVar6;
*(undefined4 *)(param_2 + 4) = puVar6[1];
*(undefined4 *)(param_2 + 8) = puVar6[2];
}
else {
(**(code **)(*(int *)this + 0x234))(&local_28,this);
fVar1 = *(float *)(this + 0x138);
fVar2 = *(float *)(this + 0x130);
*(float *)(param_1 + 4) = *(float *)(this + 0x134) + local_24;
*(float *)(param_1 + 8) = fVar1 + local_20;
*(float *)param_1 = fVar2 + local_28;
pfVar8 = (float *)(**(code **)(*(int *)this + 0x238))(this);
fVar1 = *(float *)(this + 0x144);
fVar2 = *(float *)(this + 0x13c);
fVar3 = pfVar8[2];
fVar4 = *pfVar8;
*(float *)(param_2 + 4) = *(float *)(this + 0x140) + pfVar8[1];
*(float *)(param_2 + 8) = fVar1 + fVar3;
*(float *)param_2 = fVar2 + fVar4;
}
SmoothViewOnStairs(this,param_1);
CalcViewRoll(this,param_2);
*(float *)param_2 = *(float *)param_2 + *(float *)(this + 0x1ab0);
*(float *)(param_2 + 4) = *(float *)(param_2 + 4) + *(float *)(this + 0x1ab4);
*(float *)(param_2 + 8) = *(float *)(param_2 + 8) + *(float *)(this + 0x1ab8);
iVar7 = GetFOV(this);
*param_3 = (float)iVar7;
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
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.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.