CTerrorPlayer::EmitTrackedSound
0x009c2280 · 235 bytes · __thiscall
_ZN13CTerrorPlayer16EmitTrackedSoundEPKcf
Decompiled
undefined (3 params)
/* CTerrorPlayer::EmitTrackedSound(char const*, float) */
void __thiscall CTerrorPlayer::EmitTrackedSound(CTerrorPlayer *this,char *param_1,float param_2)
{
float fVar1;
int iVar2;
int *piVar3;
float fVar4;
char *local_24;
float local_20;
local_24 = (char *)0x0;
if ((param_1 != (char *)0x0) && (*param_1 != '\0')) {
local_24 = param_1;
}
local_20 = 0.0;
if (param_2 != 0.0) {
local_20 = *(float *)(gpGlobals + 0xc) + param_2;
}
if (*(int *)(this + 0x2b54) < 1) {
LAB_009c22f1:
CBaseEntity::EmitSound((CBaseEntity *)this,param_1,0.0,(float *)0x0);
CUtlVector<CTerrorPlayer::TrackedSoundType,CUtlMemory<CTerrorPlayer::TrackedSoundType,int>>::
InsertBefore((CUtlVector<CTerrorPlayer::TrackedSoundType,CUtlMemory<CTerrorPlayer::TrackedSoundType,int>>
*)(this + 0x2b48),*(int *)(this + 0x2b54),(TrackedSoundType *)&local_24);
}
else {
piVar3 = *(int **)(this + 0x2b48);
if (local_24 != (char *)*piVar3) {
iVar2 = 0;
do {
piVar3 = piVar3 + 2;
iVar2 = iVar2 + 1;
if (iVar2 == *(int *)(this + 0x2b54)) goto LAB_009c22f1;
} while (local_24 != (char *)*piVar3);
if (iVar2 == -1) goto LAB_009c22f1;
}
if ((param_2 != 0.0) && (fVar1 = (float)piVar3[1], fVar1 != 0.0)) {
fVar4 = param_2 + *(float *)(gpGlobals + 0xc);
if (fVar4 <= fVar1) {
fVar4 = fVar1;
}
piVar3[1] = (int)fVar4;
return;
}
}
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.