CGlobalEntityList::NotifyCreateEntity
0x0067e6f0 · 378 bytes · __thiscall
_ZN17CGlobalEntityList18NotifyCreateEntityEP11CBaseEntity
Decompiled
undefined (2 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CGlobalEntityList::NotifyCreateEntity(CBaseEntity*) */
void __thiscall CGlobalEntityList::NotifyCreateEntity(CGlobalEntityList *this,CBaseEntity *param_1)
{
CUtlVector<EntsByStringList_t,CUtlMemory<EntsByStringList_t,int>> *this_00;
undefined4 *puVar1;
uint uVar2;
uint uVar3;
int iVar4;
char *pcVar5;
char *pcVar6;
int iVar7;
uint local_20;
if (param_1 == (CBaseEntity *)0x0) {
return;
}
pcVar5 = *(char **)(param_1 + 0x7c);
if (pcVar5 == (char *)0x0) {
pcVar5 = "";
}
pcVar6 = pcVar5;
if (*pcVar5 == '\0') {
pcVar6 = (char *)0x0;
pcVar5 = "";
}
local_20 = HashInt((int)pcVar5);
if (DAT_00fc9116 == '\0') {
local_20 = local_20 % DAT_00fc910c;
}
else {
local_20 = local_20 & _DAT_00fc9118;
}
this_00 = (CUtlVector<EntsByStringList_t,CUtlMemory<EntsByStringList_t,int>> *)
(g_EntsByClassname + local_20 * 0x14);
uVar2 = *(uint *)(this_00 + 0xc);
if ((int)uVar2 < 1) {
if (uVar2 == 0) {
LAB_0067e77c:
CUtlVector<EntsByStringList_t,CUtlMemory<EntsByStringList_t,int>>::GrowVector(this_00,1);
CUtlVector<EntsByStringList_t,CUtlMemory<EntsByStringList_t,int>>::ShiftElementsRight
(this_00,uVar2,1);
puVar1 = (undefined4 *)(*(int *)this_00 + uVar2 * 8);
if (puVar1 != (undefined4 *)0x0) {
*puVar1 = pcVar6;
puVar1[1] = 0;
}
uVar3 = local_20 << 0x10 | uVar2;
goto LAB_0067e7e8;
}
uVar3 = 0;
}
else {
uVar3 = 0;
pcVar5 = (char *)**(undefined4 **)this_00;
while (pcVar6 != pcVar5) {
uVar3 = uVar3 + 1;
if (uVar3 == uVar2) goto LAB_0067e77c;
pcVar5 = (char *)(*(undefined4 **)this_00)[uVar3 * 2];
}
}
uVar3 = local_20 << 0x10 | uVar3;
LAB_0067e7e8:
iVar7 = *(int *)(g_EntsByClassname + (uVar3 >> 0x10) * 0x14) + (uVar3 & 0xffff) * 8;
*(uint *)(param_1 + 0x3d0) = uVar3;
if (*(int *)(iVar7 + 4) != 0) {
*(CBaseEntity **)(*(int *)(iVar7 + 4) + 0x3d4) = param_1;
*(undefined4 *)(param_1 + 0x3d8) = *(undefined4 *)(iVar7 + 4);
}
*(CBaseEntity **)(iVar7 + 4) = param_1;
iVar7 = *(int *)(this + 0x10030) + -1;
iVar4 = iVar7 * 4;
if (-1 < iVar7) {
do {
iVar7 = iVar7 + -1;
puVar1 = (undefined4 *)(*(int *)(this + 0x10024) + iVar4);
iVar4 = iVar4 + -4;
(*(code *)**(undefined4 **)*puVar1)((undefined4 *)*puVar1,param_1);
} while (iVar7 != -1);
}
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.