CBaseEntity::GetTouchingEntities
0x00475500 · 362 bytes · __thiscall
_ZN11CBaseEntity19GetTouchingEntitiesER10CUtlVectorIPS_10CUtlMemoryIS1_iEE
Decompiled
undefined (2 params)
/* CBaseEntity::GetTouchingEntities(CUtlVector<CBaseEntity*, CUtlMemory<CBaseEntity*, int> >&) */
void __thiscall CBaseEntity::GetTouchingEntities(CBaseEntity *this,CUtlVector *param_1)
{
uint *puVar1;
uint uVar2;
int iVar3;
uint *puVar4;
int iVar5;
void *pvVar6;
undefined *puVar7;
int iVar8;
int iVar9;
undefined4 local_24;
puVar4 = (uint *)GetDataObject(this,1);
if (puVar4 != (uint *)0x0) {
for (puVar1 = (uint *)puVar4[2]; puVar4 != puVar1; puVar1 = (uint *)puVar1[2]) {
local_24 = 0;
uVar2 = *puVar1;
if (((uVar2 != 0xffffffff) &&
(puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) {
local_24 = *(undefined4 *)(puVar7 + 4);
}
iVar3 = *(int *)(param_1 + 0xc);
iVar9 = *(int *)(param_1 + 4);
iVar8 = iVar3 + 1;
if (iVar9 < iVar8) {
iVar5 = *(int *)(param_1 + 8);
if (iVar5 < 0) goto LAB_00475584;
if (iVar5 == 0) {
if (iVar9 == 0) {
if (iVar8 < 9) {
iVar5 = 8;
goto LAB_0047560f;
}
iVar9 = 8;
}
do {
iVar5 = iVar9 * 2;
if (iVar8 <= iVar5) break;
iVar5 = iVar9 * 4;
iVar9 = iVar5;
} while (iVar5 < iVar8);
}
else {
for (iVar5 = (iVar3 / iVar5 + 1) * iVar5; iVar5 < iVar8; iVar5 = (iVar5 + iVar8) / 2) {
}
}
LAB_0047560f:
*(int *)(param_1 + 4) = iVar5;
if (*(void **)param_1 == (void *)0x0) {
pvVar6 = malloc(iVar5 << 2);
*(void **)param_1 = pvVar6;
}
else {
pvVar6 = realloc(*(void **)param_1,iVar5 << 2);
*(void **)param_1 = pvVar6;
iVar8 = *(int *)(param_1 + 0xc) + 1;
}
}
else {
LAB_00475584:
pvVar6 = *(void **)param_1;
}
*(int *)(param_1 + 0xc) = iVar8;
iVar9 = iVar3 * 4;
iVar8 = (iVar8 - iVar3) + -1;
*(void **)(param_1 + 0x10) = pvVar6;
if (0 < iVar8) {
_V_memmove((void *)((int)pvVar6 + iVar9 + 4),(void *)((int)pvVar6 + iVar9),iVar8 * 4);
pvVar6 = *(void **)param_1;
}
if ((undefined4 *)(iVar9 + (int)pvVar6) != (undefined4 *)0x0) {
*(undefined4 *)(iVar9 + (int)pvVar6) = local_24;
}
}
}
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.