CDynamicLight::Spawn
0x0066a880 · 506 bytes · __thiscall
_ZN13CDynamicLight5SpawnEv
Decompiled
undefined (1 param)
/* CDynamicLight::Spawn() */
void __thiscall CDynamicLight::Spawn(CDynamicLight *this)
{
CDynamicLight CVar1;
CBaseEdict *this_00;
int iVar2;
int iVar3;
int iVar4;
int iVar5;
int iVar6;
undefined1 local_24 [20];
(**(code **)(*(int *)this + 0x6c))(this);
CCollisionProperty::SetSolid((CCollisionProperty *)(this + 0x194),0);
this[0x443] = (CDynamicLight)0x1;
UTIL_SetSize((CBaseEntity *)this,(Vector *)&vec3_origin,(Vector *)&vec3_origin);
*(uint *)(this + 0x14c) = *(uint *)(this + 0x14c) | 0x80;
CBaseEntity::DispatchUpdateTransmitState((CBaseEntity *)this);
if (*(int *)(this + 0xf8) != 0) {
CBaseEntity::ThinkSet((_func_void *)local_24,(float)this,(char *)DynamicLightThink);
CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 0.1,(char *)0x0);
}
iVar3 = *(int *)(this + 0x448);
if (iVar3 < 0x80) {
if (-0x80 < iVar3) {
return;
}
CVar1 = this[0x14d];
iVar6 = -0x7f;
}
else {
CVar1 = this[0x14d];
iVar6 = 0x7f;
}
if (((byte)CVar1 & 8) == 0) {
iVar5 = (int)*(float *)(this + 0x2e0);
iVar2 = iVar5;
iVar4 = iVar5;
}
else {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
iVar5 = (int)*(float *)(this + 0x2e0);
iVar2 = iVar5;
iVar4 = iVar5;
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
iVar4 = (int)*(float *)(this + 0x2e0);
iVar2 = iVar4;
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
iVar2 = (int)*(float *)(this + 0x2e0);
}
}
}
Warning("light_dynamic at [%d %d %d] has invalid exponent value (%d must be between %d and %d).\n"
,iVar2,iVar4,iVar5,iVar3,0xffffff81,0x7f);
if (iVar6 != *(int *)(this + 0x448)) {
if (this[0x6c] == (CDynamicLight)0x0) {
this_00 = *(CBaseEdict **)(this + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CDynamicLight)((byte)this[0x70] | 1);
}
*(int *)(this + 0x448) = iVar6;
return;
}
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.