CTerrorGun::CycleZoom
0x005667f0 · 347 bytes · __thiscall
_ZN10CTerrorGun9CycleZoomEv
Decompiled
undefined (1 param)
/* CTerrorGun::CycleZoom() */
void __thiscall CTerrorGun::CycleZoom(CTerrorGun *this)
{
code *pcVar1;
char cVar2;
CBasePlayer *this_00;
int iVar3;
int iVar4;
int *piVar5;
undefined4 uVar6;
this_00 = (CBasePlayer *)CTerrorWeapon::GetPlayerOwner((CTerrorWeapon *)this);
if (this_00 != (CBasePlayer *)0x0) {
iVar3 = CBasePlayer::GetFOV(this_00);
iVar4 = CBasePlayer::GetDefaultFOV(this_00);
if (iVar3 == iVar4) {
cVar2 = ShouldUnzoom(this);
if (cVar2 != '\0') {
return;
}
iVar3 = (**(code **)(*(int *)this + 0x714))(this);
CBasePlayer::SetFOV(this_00,(CBaseEntity *)this_00,iVar3,0.3,0);
}
else {
iVar3 = CBasePlayer::GetFOV(this_00);
iVar4 = (**(code **)(*(int *)this + 0x714))(this);
if (iVar3 == iVar4) {
CBasePlayer::SetFOV(this_00,(CBaseEntity *)this_00,0,0.1,0);
}
}
(**(code **)(*(int *)this_00 + 0x81c))(this_00);
CBaseEntity::EmitSound((CBaseEntity *)this,"Default.Zoom",0.0,(float *)0x0);
piVar5 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"weapon_zoom",0,0);
if (piVar5 != (int *)0x0) {
pcVar1 = *(code **)(*piVar5 + 0x30);
uVar6 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this_00 + 0x30));
(*pcVar1)(piVar5,"userid",uVar6);
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar5,0);
}
}
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.