CTerrorGun::AddFireBulletSpread
0x005665e0 · 169 bytes · __thiscall
_ZN10CTerrorGun19AddFireBulletSpreadEv
Decompiled
undefined (1 param)
/* CTerrorGun::AddFireBulletSpread() */
void __thiscall CTerrorGun::AddFireBulletSpread(CTerrorGun *this)
{
char cVar1;
CBasePlayer *this_00;
int iVar2;
int iVar3;
int iVar4;
float fVar5;
float fVar6;
this_00 = (CBasePlayer *)CTerrorWeapon::GetPlayerOwner((CTerrorWeapon *)this);
if (this_00 != (CBasePlayer *)0x0) {
iVar2 = CTerrorWeapon::GetTerrorWeaponData((CTerrorWeapon *)this);
fVar5 = *(float *)(iVar2 + 0xc10);
iVar3 = CBasePlayer::GetFOV(this_00);
iVar4 = CBasePlayer::GetDefaultFOV(this_00);
fVar5 = ((float)iVar3 * fVar5) / (float)iVar4;
cVar1 = (**(code **)(*(int *)this + 0x6b4))(this,2);
if (cVar1 != '\0') {
fVar5 = fVar5 * *(float *)(upgrade_laser_sight_spread_factor._28_4_ + 0x2c);
}
fVar6 = fVar5 + *(float *)(this + 0x17f0);
if (*(float *)(iVar2 + 0xc14) <= fVar5 + *(float *)(this + 0x17f0)) {
fVar6 = *(float *)(iVar2 + 0xc14);
}
*(float *)(this + 0x17f0) = fVar6;
}
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.