MapEntity_ParseEntity
0x006f10f0 · 356 bytes · __cdecl
_Z21MapEntity_ParseEntityRP11CBaseEntityPKcP16IMapEntityFilter
Decompiled
undefined (3 params)
/* MapEntity_ParseEntity(CBaseEntity*&, char const*, IMapEntityFilter*) */
void MapEntity_ParseEntity(CBaseEntity **param_1,char *param_2,IMapEntityFilter *param_3)
{
char cVar1;
CBaseEntity *this;
int in_GS_OFFSET;
char *local_182c;
undefined4 local_1828;
char *local_1824;
char local_1820 [2048];
char local_1020 [2048];
char local_820 [2048];
int local_20;
local_1828 = 0xffffffff;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
local_182c = param_2;
local_1824 = param_2;
cVar1 = CEntityMapData::ExtractValue((CEntityMapData *)&local_182c,"classname",local_1820);
if (cVar1 == '\0') {
Error("classname missing from entity!\n");
}
*param_1 = (CBaseEntity *)0x0;
if (param_3 == (IMapEntityFilter *)0x0) {
this = (CBaseEntity *)CreateEntityByName(local_1820,-1,true);
*param_1 = this;
}
else {
cVar1 = (*(code *)**(undefined4 **)param_3)(param_3,local_1820);
if (cVar1 == '\0') {
cVar1 = CEntityMapData::GetFirstKey((CEntityMapData *)&local_182c,local_1020,local_820);
while (cVar1 != '\0') {
cVar1 = CEntityMapData::GetNextKey((CEntityMapData *)&local_182c,local_1020,local_820);
}
goto LAB_006f11a0;
}
this = (CBaseEntity *)(**(code **)(*(int *)param_3 + 4))(param_3,local_1820);
*param_1 = this;
}
if (this == (CBaseEntity *)0x0) {
DevWarning("Can\'t init %s\n",local_1820);
}
else {
CBaseEntity::ParseMapData(this,(CEntityMapData *)&local_182c);
}
LAB_006f11a0:
CEntityMapData::CurrentBufferPosition((CEntityMapData *)&local_182c);
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.