UTIL_PrecacheOther
0x00b2d960 · 264 bytes · __cdecl
_Z18UTIL_PrecacheOtherPKcS0_
Decompiled
undefined (2 params)
/* UTIL_PrecacheOther(char const*, char const*) */
void UTIL_PrecacheOther(char *param_1,char *param_2)
{
CBaseEdict *this;
char cVar1;
CBaseEntity *this_00;
undefined1 *puVar2;
int iVar3;
int iVar4;
undefined1 *local_10;
cVar1 = CPrecacheOtherList::AddOrMarkPrecached(g_PrecacheOtherList);
if (cVar1 == '\0') {
return;
}
this_00 = (CBaseEntity *)CreateEntityByName(param_1,-1,true);
if (this_00 != (CBaseEntity *)0x0) {
if ((param_2 != (char *)0x0) && (*param_2 != '\0')) {
AllocPooledString((char *)&local_10);
*(undefined1 **)(this_00 + 0x260) = local_10;
CBaseEntity::DispatchUpdateTransmitState(this_00);
puVar2 = &DAT_00d539c2;
if (local_10 != (undefined1 *)0x0) {
puVar2 = local_10;
}
iVar3 = (**(code **)(*soundemitterbase + 0x88))(soundemitterbase,puVar2);
if (iVar3 != *(int *)(this_00 + 0xf4)) {
if (this_00[0x6c] == (CBaseEntity)0x0) {
this = *(CBaseEdict **)(this_00 + 0x30);
if (this != (CBaseEdict *)0x0) {
*(uint *)this = *(uint *)this | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(this);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
this_00[0x70] = (CBaseEntity)((byte)this_00[0x70] | 1);
}
*(int *)(this_00 + 0xf4) = iVar3;
}
}
cVar1 = (**(code **)(*(int *)this_00 + 0x68))(this_00);
if (cVar1 != '\0') {
(**(code **)(*(int *)this_00 + 0x6c))(this_00);
}
UTIL_RemoveImmediate(this_00);
return;
}
Warning();
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.