DescribeGroundList
0x00640580 · 491 bytes · __regparm3
_ZL18DescribeGroundListP11CBaseEntity
Decompiled
undefined (1 param)
/* DescribeGroundList(CBaseEntity*) */
int __regparm3 DescribeGroundList(CBaseEntity *param_1)
{
uint uVar1;
int iVar2;
uint *puVar3;
undefined1 *puVar4;
CBaseEntity *pCVar5;
undefined1 *puVar6;
undefined *puVar7;
char *pcVar8;
uint *puVar9;
int iVar10;
if (param_1 == (CBaseEntity *)0x0) {
return 0;
}
iVar2 = CBaseEntity::GetGroundEntity(param_1);
pcVar8 = "NULL";
if (iVar2 != 0) {
iVar2 = CBaseEntity::GetGroundEntity(param_1);
pcVar8 = "";
if (*(char **)(iVar2 + 0x7c) != (char *)0x0) {
pcVar8 = *(char **)(iVar2 + 0x7c);
}
}
iVar2 = CBaseEntity::GetGroundEntity(param_1);
puVar6 = (undefined1 *)0xffffffff;
if (iVar2 != 0) {
iVar2 = CBaseEntity::GetGroundEntity(param_1);
if (*(int *)(iVar2 + 0x30) == 0) {
puVar6 = (undefined1 *)0x0;
}
else {
puVar6 = (undefined1 *)(*(int *)(iVar2 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4);
}
}
puVar4 = &DAT_00d539c2;
if (*(undefined1 **)(param_1 + 0x7c) != (undefined1 *)0x0) {
puVar4 = *(undefined1 **)(param_1 + 0x7c);
}
if (*(int *)(param_1 + 0x30) == 0) {
iVar2 = 0;
}
else {
iVar2 = *(int *)(param_1 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
Msg("%i : %s (ground %i %s)\n",iVar2,puVar4,puVar6,pcVar8);
puVar3 = (uint *)CBaseEntity::GetDataObject(param_1,0);
if ((puVar3 == (uint *)0x0) || (puVar9 = (uint *)puVar3[1], puVar3 == puVar9)) {
iVar2 = 0;
}
else {
iVar10 = 2;
LAB_0064068f:
do {
iVar2 = iVar10;
uVar1 = *puVar9;
iVar10 = iVar2 + -1;
if ((((uVar1 == 0xffffffff) ||
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar7 + 8) != uVar1 >> 0xc)) ||
(pCVar5 = *(CBaseEntity **)(puVar7 + 4), pCVar5 == (CBaseEntity *)0x0)) {
Msg(" %02i: NULL link\n",iVar10,puVar4,puVar6,pcVar8);
}
else {
puVar6 = &DAT_00d539c2;
if (*(undefined1 **)(pCVar5 + 0x7c) != (undefined1 *)0x0) {
puVar6 = *(undefined1 **)(pCVar5 + 0x7c);
}
if (*(int *)(pCVar5 + 0x30) == 0) {
puVar4 = (undefined1 *)0x0;
}
else {
puVar4 = (undefined1 *)(*(int *)(pCVar5 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4);
}
Msg(" %02i: %i %s\n",iVar10,puVar4,puVar6,pcVar8);
pCVar5 = (CBaseEntity *)CBaseEntity::GetGroundEntity(pCVar5);
if (param_1 != pCVar5) {
Msg(" mismatched!!!\n",iVar10,puVar4,puVar6);
puVar9 = (uint *)puVar9[1];
iVar10 = iVar2 + 1;
if (puVar3 == puVar9) break;
goto LAB_0064068f;
}
}
puVar9 = (uint *)puVar9[1];
iVar10 = iVar2 + 1;
} while (puVar3 != puVar9);
iVar2 = iVar2 + -1;
}
CBaseEntity::GetGroundEntity(param_1);
return iVar2;
}
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.