CUtlVector<CPassengerSeatTransition,CUtlMemory<CPassengerSeatTransition,int>>::Sort
0x00b3d120 · 207 bytes · __thiscall
_ZN10CUtlVectorI24CPassengerSeatTransition10CUtlMemoryIS0_iEE4SortEPFiPKS0_S5_E
Decompiled
undefined (2 params)
/* CUtlVector<CPassengerSeatTransition, CUtlMemory<CPassengerSeatTransition, int> >::Sort(int
(*)(CPassengerSeatTransition const*, CPassengerSeatTransition const*)) */
void __thiscall
CUtlVector<CPassengerSeatTransition,CUtlMemory<CPassengerSeatTransition,int>>::Sort
(CUtlVector<CPassengerSeatTransition,CUtlMemory<CPassengerSeatTransition,int>> *this,
_func_int_CPassengerSeatTransition_ptr_CPassengerSeatTransition_ptr *param_1)
{
int iVar1;
size_t __nmemb;
undefined4 uVar2;
undefined4 uVar3;
undefined4 uVar4;
int iVar5;
undefined4 *puVar6;
undefined4 *puVar7;
int local_28;
int local_20;
__nmemb = *(size_t *)(this + 0xc);
if (1 < (int)__nmemb) {
if (*(void **)this == (void *)0x0) {
local_28 = __nmemb - 1;
do {
if (0 < local_28) {
local_20 = 1;
do {
while( true ) {
iVar1 = local_20 * 8;
iVar5 = (*param_1)((CPassengerSeatTransition *)(*(int *)this + iVar1 + -8),
(CPassengerSeatTransition *)(*(int *)this + iVar1));
if (-1 < iVar5) break;
local_20 = local_20 + 1;
puVar7 = (undefined4 *)(iVar1 + -8 + *(int *)this);
puVar6 = (undefined4 *)(iVar1 + *(int *)this);
uVar2 = *puVar7;
uVar3 = puVar7[1];
uVar4 = puVar6[1];
*puVar7 = *puVar6;
puVar7[1] = uVar4;
puVar6[1] = uVar3;
*puVar6 = uVar2;
if (local_28 < local_20) goto LAB_00b3d1e0;
}
local_20 = local_20 + 1;
} while (local_20 <= local_28);
}
LAB_00b3d1e0:
local_28 = local_28 + -1;
if (local_28 == -1) {
return;
}
} while( true );
}
qsort(*(void **)this,__nmemb,8,(__compar_fn_t)param_1);
}
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.