CWorld::Spawn
0x00b60c60 · 343 bytes · __thiscall
_ZN6CWorld5SpawnEv
Decompiled
undefined (1 param)
/* CWorld::Spawn() */
void __thiscall CWorld::Spawn(CWorld *this)
{
code *pcVar1;
CBaseEdict *this_00;
undefined4 uVar2;
int iVar3;
int iVar4;
undefined1 *puVar5;
undefined1 *local_10;
CBaseEntity::SetLocalOrigin((CBaseEntity *)this,(Vector *)&vec3_origin);
CBaseEntity::SetLocalAngles((CBaseEntity *)this,(QAngle *)&vec3_angle);
(**(code **)(*(int *)this + 0x24))(this,1);
pcVar1 = *(code **)(*modelinfo + 0x10);
uVar2 = CBaseEntity::GetModel((CBaseEntity *)this);
(*pcVar1)(modelinfo,uVar2);
AllocPooledString((char *)&local_10);
*(undefined1 **)(this + 0x260) = local_10;
CBaseEntity::DispatchUpdateTransmitState((CBaseEntity *)this);
puVar5 = &DAT_00d539c2;
if (local_10 != (undefined1 *)0x0) {
puVar5 = local_10;
}
iVar3 = (**(code **)(*soundemitterbase + 0x88))(soundemitterbase,puVar5);
if (iVar3 != *(int *)(this + 0xf4)) {
if (this[0x6c] == (CWorld)0x0) {
this_00 = *(CBaseEdict **)(this + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
this[0x70] = (CWorld)((byte)this[0x70] | 1);
}
*(int *)(this + 0xf4) = iVar3;
}
CBaseEntity::AddFlag((CBaseEntity *)this,0x1000000);
CEventQueue::Init((CEventQueue *)g_EventQueue);
(**(code **)(*(int *)this + 0x6c))(this);
puVar5 = *(undefined1 **)(gpGlobals + 0x3c);
if (puVar5 == (undefined1 *)0x0) {
puVar5 = &DAT_00d539c2;
}
GlobalEntity_Add("is_console",puVar5,0);
puVar5 = &DAT_00d539c2;
if (*(undefined1 **)(gpGlobals + 0x3c) != (undefined1 *)0x0) {
puVar5 = *(undefined1 **)(gpGlobals + 0x3c);
}
GlobalEntity_Add("is_pc",puVar5,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.