CCSPlayer::FlashlightTurnOn
0x00651f80 · 371 bytes · __thiscall
_ZN9CCSPlayer16FlashlightTurnOnEb
Decompiled
undefined (2 params)
/* CCSPlayer::FlashlightTurnOn(bool) */
undefined4 __thiscall CCSPlayer::FlashlightTurnOn(CCSPlayer *this,bool param_1)
{
char cVar1;
undefined4 uVar2;
int iVar3;
float local_54;
int local_50;
Vector local_48 [12];
undefined **local_3c [11];
if ((0 < *(int *)(flashlight._28_4_ + 0x30)) &&
(cVar1 = (**(code **)(*(int *)this + 300))(this), cVar1 != '\0')) {
uVar2 = (**(code **)(*(int *)this + 0x884))(this);
if ((char)uVar2 == '\0') {
return uVar2;
}
if ((*(uint *)(this + 0xd4) & 4) == 0) {
CBaseEntity::AddEffects((CBaseEntity *)this,4);
if (!param_1) {
return uVar2;
}
(**(code **)(*(int *)this + 0x28c))(local_48,this);
CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_3c);
local_3c[0] = &PTR__CPASFilter_00bfaf28;
/* try { // try from 00652026 to 0065202a has its CatchHandler @ 00652118 */
CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_3c,local_48);
local_3c[0] = &PTR__CPASAttenuationFilter_00c08ec8;
/* try { // try from 00652039 to 00652096 has its CatchHandler @ 00652116 */
iVar3 = CBaseEntity::LookupSoundLevel("Player.FlashlightOn");
local_54 = 4.0;
if (0x32 < iVar3) {
local_54 = 20.0 / (float)(iVar3 + -0x32);
}
(**(code **)(*(int *)this + 0x28c))(local_48,this);
CPASAttenuationFilter::Filter((CPASAttenuationFilter *)local_3c,local_48,local_54);
/* try { // try from 0065209e to 006520e8 has its CatchHandler @ 006520fd */
CRecipientFilter::RemoveRecipient((CRecipientFilter *)local_3c,(CBasePlayer *)this);
local_50 = 0;
if (*(int *)(this + 0x30) != 0) {
local_50 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
CBaseEntity::EmitSound
((IRecipientFilter *)local_3c,local_50,"Player.FlashlightOn",(Vector *)0x0,0.0,
(float *)0x0);
local_3c[0] = &PTR__CPASFilter_00bfaf28;
CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_3c);
return uVar2;
}
}
return 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.