BreakModelList
0x00498e40 · 458 bytes · __cdecl
_Z14BreakModelListR10CUtlVectorI12breakmodel_t10CUtlMemoryIS0_iEEifi
Decompiled
undefined (4 params)
/* BreakModelList(CUtlVector<breakmodel_t, CUtlMemory<breakmodel_t, int> >&, int, float, int) */
void BreakModelList(CUtlVector *param_1,int param_2,float param_3,int param_4)
{
int iVar1;
char cVar2;
int iVar3;
int *piVar4;
char *pcVar5;
int iVar6;
void *pvVar7;
int iVar8;
undefined **local_2c;
int local_28;
float local_24;
iVar3 = (**(code **)(*modelinfo + 0x18))(modelinfo,param_2);
if (iVar3 == 0) {
return;
}
piVar4 = (int *)(**(code **)(*physcollision + 0xa0))(physcollision,iVar3);
do {
cVar2 = (**(code **)(*piVar4 + 0xc))(piVar4);
while( true ) {
if (cVar2 != '\0') {
(**(code **)(*physcollision + 0xa4))(physcollision,piVar4);
return;
}
local_2c = &PTR_ParseKeyValue_00c1a818;
local_24 = param_3;
local_28 = param_4;
pcVar5 = (char *)(**(code **)(*piVar4 + 8))(piVar4);
iVar3 = _V_stricmp(pcVar5,"break");
if (iVar3 != 0) break;
iVar1 = *(int *)(param_1 + 0xc);
iVar8 = *(int *)(param_1 + 4);
iVar3 = iVar1 + 1;
if (iVar8 < iVar3) {
iVar6 = *(int *)(param_1 + 8);
if (iVar6 < 0) goto LAB_00498edb;
if (iVar6 == 0) {
if (iVar8 == 0) {
if (iVar3 < 2) {
iVar6 = 1;
goto LAB_00498fa7;
}
iVar8 = 1;
}
do {
iVar6 = iVar8 * 2;
if (iVar3 <= iVar6) break;
iVar6 = iVar8 * 4;
iVar8 = iVar6;
} while (iVar6 < iVar3);
}
else {
for (iVar6 = (iVar1 / iVar6 + 1) * iVar6; iVar6 < iVar3; iVar6 = (iVar6 + iVar3) / 2) {
}
}
LAB_00498fa7:
*(int *)(param_1 + 4) = iVar6;
if (*(void **)param_1 == (void *)0x0) {
pvVar7 = malloc(iVar6 * 0x42c);
*(void **)param_1 = pvVar7;
}
else {
pvVar7 = realloc(*(void **)param_1,iVar6 * 0x42c);
*(void **)param_1 = pvVar7;
iVar3 = *(int *)(param_1 + 0xc) + 1;
}
}
else {
LAB_00498edb:
pvVar7 = *(void **)param_1;
}
*(int *)(param_1 + 0xc) = iVar3;
iVar8 = iVar1 * 0x42c;
iVar3 = (iVar3 - iVar1) + -1;
*(void **)(param_1 + 0x10) = pvVar7;
if (0 < iVar3) {
_V_memmove((void *)((int)pvVar7 + iVar8 + 0x42c),(void *)((int)pvVar7 + iVar8),iVar3 * 0x42c
);
pvVar7 = *(void **)param_1;
}
(**(code **)(*piVar4 + 0x20))(piVar4,(void *)(iVar8 + (int)pvVar7),&local_2c);
cVar2 = (**(code **)(*piVar4 + 0xc))(piVar4);
}
(**(code **)(*piVar4 + 0x28))(piVar4);
} while( true );
}
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.