CUtlVector<FloorInfo,CUtlMemory<FloorInfo,int>>::Sort
0x006bf6e0 · 212 bytes · __thiscall
_ZN10CUtlVectorI9FloorInfo10CUtlMemoryIS0_iEE4SortEPFiPKS0_S5_E
Decompiled
undefined (2 params)
/* CUtlVector<FloorInfo, CUtlMemory<FloorInfo, int> >::Sort(int (*)(FloorInfo const*, FloorInfo
const*)) */
void __thiscall
CUtlVector<FloorInfo,CUtlMemory<FloorInfo,int>>::Sort
(CUtlVector<FloorInfo,CUtlMemory<FloorInfo,int>> *this,
_func_int_FloorInfo_ptr_FloorInfo_ptr *param_1)
{
undefined4 uVar1;
size_t __nmemb;
undefined4 uVar2;
undefined4 uVar3;
int iVar4;
int iVar5;
int iVar6;
undefined4 *puVar7;
undefined4 *puVar8;
int local_24;
__nmemb = *(size_t *)(this + 0xc);
if (1 < (int)__nmemb) {
if (*(void **)this == (void *)0x0) {
local_24 = __nmemb - 1;
do {
if (0 < local_24) {
iVar5 = 1;
do {
while( true ) {
iVar6 = iVar5 * 0xc;
iVar4 = (*param_1)((FloorInfo *)(*(int *)this + iVar6 + -0xc),
(FloorInfo *)(*(int *)this + iVar6));
if (-1 < iVar4) break;
iVar5 = iVar5 + 1;
puVar8 = (undefined4 *)(iVar6 + -0xc + *(int *)this);
puVar7 = (undefined4 *)(iVar6 + *(int *)this);
uVar2 = puVar8[2];
uVar1 = *puVar8;
uVar3 = puVar8[1];
*puVar8 = *puVar7;
puVar8[1] = puVar7[1];
puVar8[2] = puVar7[2];
*puVar7 = uVar1;
puVar7[1] = uVar3;
puVar7[2] = uVar2;
if (local_24 < iVar5) goto LAB_006bf7a8;
}
iVar5 = iVar5 + 1;
} while (iVar5 <= local_24);
}
LAB_006bf7a8:
local_24 = local_24 + -1;
if (local_24 == -1) {
return;
}
} while( true );
}
qsort(*(void **)this,__nmemb,0xc,(__compar_fn_t)param_1);
}
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.