physicssound::AddImpactSound
0x00779bd0 · 672 bytes · __cdecl
_ZN12physicssound14AddImpactSoundERNS_11soundlist_tEPviiP14IPhysicsObjectiiff
Decompiled
undefined (9 params)
/* physicssound::AddImpactSound(physicssound::soundlist_t&, void*, int, int, IPhysicsObject*, int,
int, float, float) */
void physicssound::AddImpactSound
(soundlist_t *param_1,void *param_2,int param_3,int param_4,IPhysicsObject *param_5,
int param_6,int param_7,float param_8,float param_9)
{
int iVar1;
int iVar2;
undefined4 *puVar3;
int iVar4;
int iVar5;
void *__ptr;
undefined4 *puVar6;
float fVar7;
float fVar8;
fVar8 = param_9 + 0.0001;
iVar1 = *(int *)(param_1 + 0xc);
if (-1 < iVar1 + -1) {
iVar4 = (iVar1 + -1) * 0x24;
__ptr = *(void **)param_1;
puVar6 = (undefined4 *)((int)__ptr + iVar4);
if (((uint)*(ushort *)(puVar6 + 5) != param_6) && (iVar1 < 5)) {
puVar3 = (undefined4 *)((int)__ptr + iVar4 + -0x24);
do {
puVar6 = puVar3;
if (puVar6 == (undefined4 *)((int)__ptr + -0x24)) goto LAB_00779c70;
puVar3 = puVar6 + -9;
} while ((uint)*(ushort *)(puVar6 + 5) != param_6);
}
fVar7 = (float)puVar6[3];
if (fVar7 < param_8) {
(**(code **)(*(int *)param_5 + 0xc4))(param_5,puVar6 + 6,0);
fVar7 = (float)puVar6[3];
*puVar6 = param_2;
puVar6[1] = param_3;
puVar6[2] = param_4;
*(undefined2 *)((int)puVar6 + 0x16) = (undefined2)param_7;
}
if (fVar8 <= (float)puVar6[4]) {
fVar8 = (float)puVar6[4];
}
puVar6[4] = fVar8;
puVar6[3] = fVar7 + param_8;
return;
}
__ptr = *(void **)param_1;
LAB_00779c70:
iVar4 = iVar1 + 1;
iVar5 = *(int *)(param_1 + 4);
if (iVar4 <= iVar5) goto LAB_00779c84;
iVar2 = *(int *)(param_1 + 8);
if (iVar2 < 0) goto LAB_00779c84;
if (iVar2 == 0) {
if (iVar5 == 0) {
if (iVar4 < 2) {
iVar5 = 1;
goto LAB_00779d87;
}
iVar5 = 1;
}
do {
iVar5 = iVar5 * 2;
} while (iVar5 < iVar4);
}
else {
for (iVar5 = (iVar1 / iVar2 + 1) * iVar2; iVar5 < iVar4; iVar5 = (iVar5 + iVar4) / 2) {
}
}
LAB_00779d87:
*(int *)(param_1 + 4) = iVar5;
if (__ptr == (void *)0x0) {
__ptr = malloc(iVar5 * 0x24);
*(void **)param_1 = __ptr;
}
else {
__ptr = realloc(__ptr,iVar5 * 0x24);
*(void **)param_1 = __ptr;
iVar4 = *(int *)(param_1 + 0xc) + 1;
}
LAB_00779c84:
*(int *)(param_1 + 0xc) = iVar4;
*(void **)(param_1 + 0x10) = __ptr;
iVar4 = (iVar4 - iVar1) + -1;
if (0 < iVar4) {
_V_memmove((void *)((int)__ptr + iVar1 * 0x24 + 0x24),(void *)((int)__ptr + iVar1 * 0x24),
iVar4 * 0x24);
__ptr = *(void **)param_1;
}
puVar6 = (undefined4 *)(iVar1 * 0x24 + (int)__ptr);
*puVar6 = param_2;
puVar6[1] = param_3;
puVar6[2] = param_4;
(**(code **)(*(int *)param_5 + 0xc4))(param_5,puVar6 + 6,0);
*(short *)(puVar6 + 5) = (short)param_6;
puVar6[3] = param_8;
*(undefined2 *)((int)puVar6 + 0x16) = (undefined2)param_7;
puVar6[4] = fVar8;
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.