CPropMountedGun::OnControls
0x0054d9d0 · 332 bytes · __thiscall
_ZN15CPropMountedGun10OnControlsEP11CBaseEntity
Decompiled
undefined (2 params)
/* CPropMountedGun::OnControls(CBaseEntity*) */
bool __thiscall CPropMountedGun::OnControls(CPropMountedGun *this,CBaseEntity *param_1)
{
uint uVar1;
undefined *puVar2;
CBaseEntity *pCVar3;
longdouble extraout_ST0;
float local_24;
float local_20;
undefined4 local_1c;
QAngle local_18 [4];
float local_14;
uVar1 = *(uint *)(this + 0x15cc);
if ((uVar1 == 0xffffffff) ||
(puVar2 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar2 == (undefined *)0xfffffffc)) {
if (param_1 == (CBaseEntity *)0x0) {
return true;
}
}
else {
if (*(uint *)(puVar2 + 8) == uVar1 >> 0xc) {
pCVar3 = *(CBaseEntity **)(puVar2 + 4);
}
else {
pCVar3 = (CBaseEntity *)0x0;
}
if (param_1 == pCVar3) {
return true;
}
if ((*(uint *)(puVar2 + 8) == uVar1 >> 0xc) && (*(int *)(puVar2 + 4) != 0)) {
return false;
}
}
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(param_1);
}
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
local_1c = 0;
local_24 = *(float *)(this + 0x2e0) - *(float *)(param_1 + 0x2e0);
local_20 = *(float *)(this + 0x2e4) - *(float *)(param_1 + 0x2e4);
VectorNormalize((Vector *)&local_24);
VectorAngles((Vector *)&local_24,local_18);
AngleNormalize(local_14 - *(float *)(this + 0x15e8));
return ABS((float)extraout_ST0) <= 45.0;
}
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.