CUtlVector<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable>>,CUtlMemory<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable>>,int>>::InsertBefore
0x008aa530 · 303 bytes · __thiscall
_ZN10CUtlVectorI18EntityLocationInfoI7CHandleI24CWeaponSpawnConfigurableEE10CUtlMemoryIS4_iEE12InsertBeforeEiRKS4_
Decompiled
undefined (3 params)
/* CUtlVector<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable> >,
CUtlMemory<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable> >, int> >::InsertBefore(int,
EntityLocationInfo<CHandle<CWeaponSpawnConfigurable> > const&) */
int __thiscall
CUtlVector<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable>>,CUtlMemory<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable>>,int>>
::InsertBefore(CUtlVector<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable>>,CUtlMemory<EntityLocationInfo<CHandle<CWeaponSpawnConfigurable>>,int>>
*this,int param_1,EntityLocationInfo *param_2)
{
undefined4 *puVar1;
void *pvVar2;
int iVar3;
int iVar4;
int iVar5;
iVar4 = *(int *)(this + 4);
iVar3 = *(int *)(this + 0xc) + 1;
if (iVar4 < iVar3) {
iVar5 = *(int *)(this + 8);
if (-1 < iVar5) {
if (iVar5 == 0) {
if (iVar4 == 0) {
if (iVar3 < 2) {
iVar5 = 1;
goto LAB_008aa607;
}
iVar4 = 1;
}
do {
iVar5 = iVar4 * 2;
if (iVar3 <= iVar5) break;
iVar5 = iVar4 * 4;
iVar4 = iVar5;
} while (iVar5 < iVar3);
}
else {
for (iVar5 = iVar5 * (*(int *)(this + 0xc) / iVar5 + 1); iVar5 < iVar3;
iVar5 = (iVar5 + iVar3) / 2) {
}
}
LAB_008aa607:
*(int *)(this + 4) = iVar5;
if (*(void **)this == (void *)0x0) {
pvVar2 = malloc(iVar5 << 5);
*(void **)this = pvVar2;
}
else {
pvVar2 = realloc(*(void **)this,iVar5 << 5);
*(void **)this = pvVar2;
iVar3 = *(int *)(this + 0xc) + 1;
}
goto LAB_008aa554;
}
}
pvVar2 = *(void **)this;
LAB_008aa554:
*(int *)(this + 0xc) = iVar3;
iVar3 = (iVar3 - param_1) + -1;
iVar4 = param_1 * 0x20;
*(void **)(this + 0x10) = pvVar2;
if (0 < iVar3) {
_V_memmove((void *)((int)pvVar2 + iVar4 + 0x20),(void *)((int)pvVar2 + iVar4),iVar3 * 0x20);
pvVar2 = *(void **)this;
}
puVar1 = (undefined4 *)((int)pvVar2 + iVar4);
if (puVar1 != (undefined4 *)0x0) {
*puVar1 = *(undefined4 *)param_2;
puVar1[1] = *(undefined4 *)(param_2 + 4);
puVar1[2] = *(undefined4 *)(param_2 + 8);
puVar1[3] = *(undefined4 *)(param_2 + 0xc);
puVar1[4] = *(undefined4 *)(param_2 + 0x10);
puVar1[5] = *(undefined4 *)(param_2 + 0x14);
puVar1[6] = *(undefined4 *)(param_2 + 0x18);
puVar1[7] = *(undefined4 *)(param_2 + 0x1c);
}
return param_1;
}
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.