CUtlSortVector<modelsize_t,CModelsize_Less>::Insert
0x0019ead0 · 431 bytes · __thiscall
_ZN14CUtlSortVectorI11modelsize_t15CModelsize_LessE6InsertERKS0_
Decompiled
undefined (2 params)
/* CUtlSortVector<modelsize_t, CModelsize_Less>::Insert(modelsize_t const&) */
int __thiscall
CUtlSortVector<modelsize_t,CModelsize_Less>::Insert
(CUtlSortVector<modelsize_t,CModelsize_Less> *this,modelsize_t *param_1)
{
undefined4 uVar1;
int iVar2;
char cVar3;
int iVar4;
undefined4 *puVar5;
void *pvVar6;
int iVar7;
int iVar8;
if ((this[0x18] != (CUtlSortVector<modelsize_t,CModelsize_Less>)0x0) &&
(iVar4 = LoggingSystem_LogAssert
("%s (%d) : %s\n","/data/src/public/tier1/utlsortvector.h",0x94,
"Assertion Failed: !m_bNeedsSort"), iVar4 == 1)) {
cVar3 = ShouldUseNewAssertDialog();
if ((cVar3 == '\0') ||
(cVar3 = DoNewAssertDialog("/data/src/public/tier1/utlsortvector.h",0x94,
"Assertion Failed: !m_bNeedsSort"), cVar3 != '\0')) {
raise(5);
}
_ExitOnFatalAssert("/data/src/public/tier1/utlsortvector.h",0x94);
}
iVar4 = FindLessOrEqual(this,param_1);
iVar7 = *(int *)(this + 4);
iVar4 = iVar4 + 1;
iVar8 = *(int *)(this + 0xc) + 1;
if (iVar7 < iVar8) {
iVar2 = *(int *)(this + 8);
if (-1 < iVar2) {
if (iVar2 == 0) {
if (iVar7 == 0) {
if (iVar8 < 5) {
iVar7 = 4;
goto LAB_0019eb92;
}
iVar7 = 4;
}
do {
iVar7 = iVar7 * 2;
} while (iVar7 < iVar8);
}
else {
for (iVar7 = iVar2 * (*(int *)(this + 0xc) / iVar2 + 1); iVar7 < iVar8;
iVar7 = (iVar7 + iVar8) / 2) {
}
}
LAB_0019eb92:
*(int *)(this + 4) = iVar7;
if (*(void **)this == (void *)0x0) {
pvVar6 = malloc(iVar7 << 3);
*(void **)this = pvVar6;
}
else {
pvVar6 = realloc(*(void **)this,iVar7 << 3);
*(void **)this = pvVar6;
iVar8 = *(int *)(this + 0xc) + 1;
}
goto LAB_0019eb07;
}
}
pvVar6 = *(void **)this;
LAB_0019eb07:
*(int *)(this + 0xc) = iVar8;
iVar8 = (iVar8 - iVar4) + -1;
*(void **)(this + 0x10) = pvVar6;
iVar7 = iVar4 * 8;
if (0 < iVar8) {
_V_memmove((void *)((int)pvVar6 + iVar7 + 8),(void *)((int)pvVar6 + iVar7),iVar8 * 8);
pvVar6 = *(void **)this;
}
puVar5 = (undefined4 *)((int)pvVar6 + iVar7);
if (puVar5 != (undefined4 *)0x0) {
uVar1 = *(undefined4 *)(param_1 + 4);
*puVar5 = *(undefined4 *)param_1;
puVar5[1] = uVar1;
}
return iVar4;
}
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.