CUtlVector<moverlay_t,CUtlMemory<moverlay_t,int>>::SetCount
0x001d5eb0 · 413 bytes · __thiscall
_ZN10CUtlVectorI10moverlay_t10CUtlMemoryIS0_iEE8SetCountEi
Decompiled
undefined (2 params)
/* CUtlVector<moverlay_t, CUtlMemory<moverlay_t, int> >::SetCount(int) */
void __thiscall
CUtlVector<moverlay_t,CUtlMemory<moverlay_t,int>>::SetCount
(CUtlVector<moverlay_t,CUtlMemory<moverlay_t,int>> *this,int param_1)
{
int iVar1;
void *pvVar2;
int iVar3;
int iVar4;
int iVar5;
int iVar6;
RemoveAll(this);
iVar6 = *(int *)(this + 0xc);
if (param_1 == 0) {
return;
}
iVar4 = *(int *)(this + 4);
iVar5 = param_1 + iVar6;
iVar3 = iVar5;
if (iVar4 < iVar5) {
iVar1 = *(int *)(this + 8);
if (iVar1 < 0) goto LAB_001d5eee;
if (iVar1 == 0) {
if (iVar4 == 0) {
if (iVar5 < 2) {
iVar4 = 1;
goto LAB_001d5fbf;
}
iVar4 = 1;
}
do {
iVar4 = iVar4 * 2;
} while (iVar4 < iVar5);
}
else {
for (iVar4 = ((iVar5 + -1) / iVar1 + 1) * iVar1; iVar4 < iVar5; iVar4 = (iVar4 + iVar5) / 2) {
}
}
LAB_001d5fbf:
*(int *)(this + 4) = iVar4;
if (*(void **)this == (void *)0x0) {
pvVar2 = malloc(iVar4 * 0xa8);
*(void **)this = pvVar2;
}
else {
pvVar2 = realloc(*(void **)this,iVar4 * 0xa8);
*(void **)this = pvVar2;
iVar3 = *(int *)(this + 0xc) + param_1;
}
}
else {
LAB_001d5eee:
pvVar2 = *(void **)this;
}
*(int *)(this + 0xc) = iVar3;
iVar4 = (iVar3 - iVar6) - param_1;
*(void **)(this + 0x10) = pvVar2;
if (iVar4 < 1) {
if (0 < param_1) {
LAB_001d5f10:
iVar6 = iVar6 * 0xa8;
iVar5 = 0;
do {
iVar4 = iVar6 + *(int *)this;
if (iVar4 != 0) {
*(undefined4 *)(iVar4 + 0xc) = 0;
*(undefined4 *)(iVar4 + 0x10) = 0;
*(undefined4 *)(iVar4 + 0x14) = 0;
*(undefined4 *)(iVar4 + 0x18) = 0;
*(undefined4 *)(iVar4 + 0x1c) = 0;
*(undefined1 *)(iVar4 + 0xa4) = 0;
*(undefined1 *)(iVar4 + 0xa5) = 0;
*(undefined1 *)(iVar4 + 0xa6) = 0;
*(undefined1 *)(iVar4 + 0xa7) = 0;
}
iVar5 = iVar5 + 1;
iVar6 = iVar6 + 0xa8;
} while (iVar5 < param_1);
return;
}
}
else if (0 < param_1) {
_V_memmove((void *)((int)pvVar2 + iVar5 * 0xa8),(void *)(iVar6 * 0xa8 + (int)pvVar2),
iVar4 * 0xa8);
goto LAB_001d5f10;
}
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.