CPointSpotlight::CreateEfficientSpotlight
0x007de1d0 · 700 bytes · __thiscall
_ZN15CPointSpotlight24CreateEfficientSpotlightEv
Decompiled
undefined (1 param)
/* CPointSpotlight::CreateEfficientSpotlight() */
void __thiscall CPointSpotlight::CreateEfficientSpotlight(CPointSpotlight *this)
{
uint uVar1;
int iVar2;
CBaseEntity *pCVar3;
undefined *puVar4;
undefined *puVar5;
longdouble lVar6;
undefined4 local_28;
undefined4 local_24;
undefined4 local_20;
uVar1 = *(uint *)(this + 0x470);
if ((((uVar1 != 0xffffffff) &&
(puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar4 + 4) != 0)) {
return;
}
SpotlightCreate(this);
SpotlightCurrentPos();
pCVar3 = (CBaseEntity *)0x0;
uVar1 = *(uint *)(this + 0x470);
*(undefined4 *)(this + 0x450) = local_28;
puVar4 = g_pEntityList;
*(undefined4 *)(this + 0x454) = local_24;
*(undefined4 *)(this + 0x458) = local_20;
if (((uVar1 != 0xffffffff) &&
(puVar4 = puVar4 + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) {
pCVar3 = *(CBaseEntity **)(puVar4 + 4);
}
CBaseEntity::SetAbsOrigin(pCVar3,(Vector *)(this + 0x450));
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
puVar4 = g_pEntityList;
uVar1 = *(uint *)(this + 0x470);
iVar2 = 0;
if (((uVar1 != 0xffffffff) &&
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) {
iVar2 = *(int *)(puVar5 + 4);
}
*(undefined4 *)(iVar2 + 0x454) = *(undefined4 *)(this + 0x2e0);
*(undefined4 *)(iVar2 + 0x458) = *(undefined4 *)(this + 0x2e4);
*(undefined4 *)(iVar2 + 0x45c) = *(undefined4 *)(this + 0x2e8);
uVar1 = *(uint *)(this + 0x470);
if (((uVar1 == 0xffffffff) ||
(puVar5 = puVar4 + (uVar1 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar5 + 8) != uVar1 >> 0xc)) {
pCVar3 = (CBaseEntity *)0x0;
}
else {
pCVar3 = *(CBaseEntity **)(puVar5 + 4);
}
if (((byte)pCVar3[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar3);
puVar4 = g_pEntityList;
}
*(float *)(pCVar3 + 0x448) = *(float *)(pCVar3 + 0x2e0) - *(float *)(pCVar3 + 0x454);
*(float *)(pCVar3 + 0x44c) = *(float *)(pCVar3 + 0x2e4) - *(float *)(pCVar3 + 0x458);
iVar2 = 0;
*(float *)(pCVar3 + 0x450) = *(float *)(pCVar3 + 0x2e8) - *(float *)(pCVar3 + 0x45c);
uVar1 = *(uint *)(this + 0x470);
if (((uVar1 != 0xffffffff) &&
(puVar4 = puVar4 + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) {
iVar2 = *(int *)(puVar4 + 4);
}
lVar6 = (longdouble)VectorNormalize((Vector *)(iVar2 + 0x448));
puVar4 = g_pEntityList;
uVar1 = *(uint *)(this + 0x470);
pCVar3 = (CBaseEntity *)0x0;
*(float *)(this + 0x478) = (float)lVar6;
if (((uVar1 != 0xffffffff) &&
(puVar4 = puVar4 + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) {
pCVar3 = *(CBaseEntity **)(puVar4 + 4);
}
CBaseEntity::SetMoveType(pCVar3,0,0);
ComputeRenderInfo(this);
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.