CPointSpotlight::SpotlightCreate
0x007dd080 · 3455 bytes · __thiscall
_ZN15CPointSpotlight15SpotlightCreateEv
Decompiled
undefined (1 param)
/* CPointSpotlight::SpotlightCreate() */
void __thiscall CPointSpotlight::SpotlightCreate(CPointSpotlight *this)
{
float fVar1;
float fVar2;
float fVar3;
CPointSpotlight CVar4;
CPointSpotlight CVar5;
CPointSpotlight CVar6;
CBaseEdict *pCVar7;
int *piVar8;
uint *puVar9;
int iVar10;
int iVar11;
uint uVar12;
CBaseEntity *pCVar13;
CBeam *pCVar14;
undefined *puVar15;
undefined *puVar16;
int iVar17;
uint uVar18;
float fVar19;
undefined *local_e0;
CTraceFilterSimple local_dc [16];
float local_cc;
float local_c8;
float local_c4;
float local_bc;
float local_b8;
float local_b4;
undefined4 local_ac;
undefined4 local_a8;
undefined4 local_a4;
undefined4 local_9c;
undefined4 local_98;
undefined4 local_94;
undefined4 local_8c;
undefined1 local_88;
undefined1 local_87;
Vector local_70 [12];
Vector local_64 [84];
uVar12 = *(uint *)(this + 0x470);
if ((((uVar12 != 0xffffffff) &&
(puVar16 = g_pEntityList + (uVar12 & 0xfff) * 0x10, puVar16 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar16 + 8) == uVar12 >> 0xc)) && (*(int *)(puVar16 + 4) != 0)) {
return;
}
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
AngleVectors((QAngle *)(this + 0x37c),(Vector *)(this + 0x45c));
fVar19 = *(float *)(this + 0x474);
fVar1 = *(float *)(this + 0x45c);
fVar2 = *(float *)(this + 0x460);
fVar3 = *(float *)(this + 0x464);
if (((byte)this[0x14d] & 8) == 0) {
local_cc = *(float *)(this + 0x2e0);
local_c8 = *(float *)(this + 0x2e4);
local_c4 = *(float *)(this + 0x2e8);
local_bc = fVar1 * fVar19 + local_cc;
local_b8 = fVar2 * fVar19 + local_c8;
local_b4 = fVar19 * fVar3 + local_c4;
}
else {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
local_cc = *(float *)(this + 0x2e0);
local_c8 = *(float *)(this + 0x2e4);
local_bc = fVar1 * fVar19 + local_cc;
local_c4 = *(float *)(this + 0x2e8);
local_b8 = fVar2 * fVar19 + local_c8;
local_b4 = fVar19 * fVar3 + local_c4;
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
local_cc = *(float *)(this + 0x2e0);
local_c8 = *(float *)(this + 0x2e4);
local_c4 = *(float *)(this + 0x2e8);
}
}
local_bc = local_bc - local_cc;
local_b4 = local_b4 - local_c4;
local_b8 = local_b8 - local_c8;
local_94 = 0;
local_98 = 0;
local_9c = 0;
local_8c = 0;
local_87 = local_bc * local_bc + local_b4 * local_b4 + local_b8 * local_b8 != 0.0;
local_88 = 1;
local_a4 = 0;
local_a8 = 0;
local_ac = 0;
CTraceFilterSimple::CTraceFilterSimple
(local_dc,(IHandleEntity *)this,0,(_func_bool_IHandleEntity_ptr_int *)0x0);
(**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,0x400b,local_dc,local_70);
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine(local_70,local_64,0xff,0,0,true,-1.0);
}
piVar8 = (int *)CreateEntityByName("spotlight_end",-1,true);
if (piVar8 == (int *)0x0) {
*(undefined4 *)(this + 0x470) = 0xffffffff;
piVar8 = (int *)0x0;
}
else {
puVar9 = (uint *)(**(code **)(*piVar8 + 0xc))(piVar8);
puVar16 = g_pEntityList;
uVar12 = *puVar9;
*(uint *)(this + 0x470) = uVar12;
if (((uVar12 == 0xffffffff) ||
(puVar16 = puVar16 + (uVar12 & 0xfff) * 0x10, puVar16 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar16 + 8) != uVar12 >> 0xc)) {
piVar8 = (int *)0x0;
}
else {
piVar8 = *(int **)(puVar16 + 4);
}
}
(**(code **)(*piVar8 + 100))(piVar8);
uVar12 = *(uint *)(this + 0x470);
pCVar13 = (CBaseEntity *)0x0;
if (((uVar12 != 0xffffffff) &&
(puVar16 = g_pEntityList + (uVar12 & 0xfff) * 0x10, puVar16 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar16 + 8) == uVar12 >> 0xc)) {
pCVar13 = *(CBaseEntity **)(puVar16 + 4);
}
CBaseEntity::SetAbsOrigin(pCVar13,local_64);
uVar12 = *(uint *)(this + 0x470);
piVar8 = (int *)0x0;
if (((uVar12 != 0xffffffff) &&
(puVar16 = g_pEntityList + (uVar12 & 0xfff) * 0x10, puVar16 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar16 + 8) == uVar12 >> 0xc)) {
piVar8 = *(int **)(puVar16 + 4);
}
iVar17 = 0;
(**(code **)(*piVar8 + 0x50))(piVar8,this);
puVar16 = g_pEntityList;
uVar12 = *(uint *)(this + 0x470);
if (((uVar12 != 0xffffffff) &&
(puVar15 = g_pEntityList + (uVar12 & 0xfff) * 0x10, puVar15 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar15 + 8) == uVar12 >> 0xc)) {
iVar17 = *(int *)(puVar15 + 4);
}
if (((*(CPointSpotlight *)(iVar17 + 0x124) != this[0x124]) ||
(*(CPointSpotlight *)(iVar17 + 0x125) != this[0x125])) ||
((*(CPointSpotlight *)(iVar17 + 0x126) != this[0x126] ||
(*(CPointSpotlight *)(iVar17 + 0x127) != this[0x127])))) {
if (*(char *)(iVar17 + 0x6c) == '\0') {
pCVar7 = *(CBaseEdict **)(iVar17 + 0x30);
if (pCVar7 != (CBaseEdict *)0x0) {
*(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
iVar10 = CBaseEdict::GetChangeAccessor(pCVar7);
*(undefined2 *)(iVar10 + 2) = 0;
puVar16 = g_pEntityList;
}
}
else {
*(byte *)(iVar17 + 0x70) = *(byte *)(iVar17 + 0x70) | 1;
}
*(undefined4 *)(iVar17 + 0x124) = *(undefined4 *)(this + 0x124);
uVar12 = *(uint *)(this + 0x470);
}
iVar17 = 0;
if (((uVar12 != 0xffffffff) &&
(puVar16 = puVar16 + (uVar12 & 0xfff) * 0x10, puVar16 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar16 + 8) == uVar12 >> 0xc)) {
iVar17 = *(int *)(puVar16 + 4);
}
fVar19 = *(float *)(this + 0x474);
if (fVar19 != *(float *)(iVar17 + 0x444)) {
if (*(char *)(iVar17 + 0x6c) == '\0') {
pCVar7 = *(CBaseEdict **)(iVar17 + 0x30);
if (pCVar7 != (CBaseEdict *)0x0) {
*(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
iVar10 = CBaseEdict::GetChangeAccessor(pCVar7);
*(undefined2 *)(iVar10 + 2) = 0;
}
}
else {
*(byte *)(iVar17 + 0x70) = *(byte *)(iVar17 + 0x70) | 1;
}
*(float *)(iVar17 + 0x444) = fVar19;
}
if (((byte)this[0x148] & 2) != 0) {
uVar12 = *(uint *)(this + 0x470);
iVar17 = 0;
if (((uVar12 != 0xffffffff) &&
(puVar16 = g_pEntityList + (uVar12 & 0xfff) * 0x10, puVar16 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar16 + 8) == uVar12 >> 0xc)) {
iVar17 = *(int *)(puVar16 + 4);
}
if (*(float *)(iVar17 + 0x440) != 0.0) {
if (*(char *)(iVar17 + 0x6c) == '\0') {
pCVar7 = *(CBaseEdict **)(iVar17 + 0x30);
if (pCVar7 != (CBaseEdict *)0x0) {
*(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
iVar10 = CBaseEdict::GetChangeAccessor(pCVar7);
*(undefined2 *)(iVar10 + 2) = 0;
}
}
else {
*(byte *)(iVar17 + 0x70) = *(byte *)(iVar17 + 0x70) | 1;
}
*(undefined4 *)(iVar17 + 0x440) = 0;
}
}
piVar8 = (int *)CBeam::BeamCreate("sprites/glow_test02.vmt",*(float *)(this + 0x47c));
if (piVar8 == (int *)0x0) {
fVar19 = *(float *)(this + 0x484);
uVar12 = 0xffffffff;
iVar17 = 0;
*(undefined4 *)(this + 0x46c) = 0xffffffff;
local_e0 = g_pEntityList;
}
else {
puVar9 = (uint *)(**(code **)(*piVar8 + 0xc))(piVar8);
local_e0 = g_pEntityList;
fVar19 = *(float *)(this + 0x484);
uVar12 = *puVar9;
*(uint *)(this + 0x46c) = uVar12;
if (((uVar12 == 0xffffffff) ||
(puVar16 = local_e0 + (uVar12 & 0xfff) * 0x10, puVar16 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar16 + 8) != uVar12 >> 0xc)) {
iVar17 = 0;
}
else {
iVar17 = *(int *)(puVar16 + 4);
}
}
if (fVar19 != *(float *)(iVar17 + 0x444)) {
if (*(char *)(iVar17 + 0x6c) == '\0') {
pCVar7 = *(CBaseEdict **)(iVar17 + 0x30);
if (pCVar7 != (CBaseEdict *)0x0) {
*(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
iVar10 = CBaseEdict::GetChangeAccessor(pCVar7);
*(undefined2 *)(iVar10 + 2) = 0;
local_e0 = g_pEntityList;
}
}
else {
*(byte *)(iVar17 + 0x70) = *(byte *)(iVar17 + 0x70) | 1;
}
*(float *)(iVar17 + 0x444) = fVar19;
uVar12 = *(uint *)(this + 0x46c);
}
iVar17 = 0;
if (((uVar12 != 0xffffffff) &&
(puVar16 = local_e0 + (uVar12 & 0xfff) * 0x10, puVar16 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar16 + 8) == uVar12 >> 0xc)) {
iVar17 = *(int *)(puVar16 + 4);
}
uVar18 = *(uint *)(iVar17 + 0x148) | 0x8000;
if (*(uint *)(iVar17 + 0x148) != uVar18) {
if (*(char *)(iVar17 + 0x6c) == '\0') {
pCVar7 = *(CBaseEdict **)(iVar17 + 0x30);
if (pCVar7 != (CBaseEdict *)0x0) {
*(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
iVar10 = CBaseEdict::GetChangeAccessor(pCVar7);
*(undefined2 *)(iVar10 + 2) = 0;
local_e0 = g_pEntityList;
}
}
else {
*(byte *)(iVar17 + 0x70) = *(byte *)(iVar17 + 0x70) | 1;
}
*(uint *)(iVar17 + 0x148) = uVar18;
uVar12 = *(uint *)(this + 0x46c);
}
CVar4 = this[0x126];
iVar17 = 0;
CVar5 = this[0x125];
CVar6 = this[0x124];
if (((uVar12 != 0xffffffff) &&
(local_e0 = local_e0 + (uVar12 & 0xfff) * 0x10, local_e0 != (undefined *)0xfffffffc)) &&
(*(uint *)(local_e0 + 8) == uVar12 >> 0xc)) {
iVar17 = *(int *)(local_e0 + 4);
}
if (CVar6 != *(CPointSpotlight *)(iVar17 + 0x124)) {
if (*(char *)(iVar17 + 0x6c) == '\0') {
pCVar7 = *(CBaseEdict **)(iVar17 + 0x30);
if (pCVar7 != (CBaseEdict *)0x0) {
*(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
iVar10 = CBaseEdict::GetChangeAccessor(pCVar7);
*(undefined2 *)(iVar10 + 2) = 0;
}
}
else {
*(byte *)(iVar17 + 0x70) = *(byte *)(iVar17 + 0x70) | 1;
}
*(CPointSpotlight *)(iVar17 + 0x124) = CVar6;
}
if (CVar5 != *(CPointSpotlight *)(iVar17 + 0x125)) {
if (*(char *)(iVar17 + 0x6c) == '\0') {
pCVar7 = *(CBaseEdict **)(iVar17 + 0x30);
if (pCVar7 != (CBaseEdict *)0x0) {
*(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
iVar10 = CBaseEdict::GetChangeAccessor(pCVar7);
*(undefined2 *)(iVar10 + 2) = 0;
}
}
else {
*(byte *)(iVar17 + 0x70) = *(byte *)(iVar17 + 0x70) | 1;
}
*(CPointSpotlight *)(iVar17 + 0x125) = CVar5;
}
if (CVar4 != *(CPointSpotlight *)(iVar17 + 0x126)) {
if (*(char *)(iVar17 + 0x6c) == '\0') {
pCVar7 = *(CBaseEdict **)(iVar17 + 0x30);
if (pCVar7 != (CBaseEdict *)0x0) {
*(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
iVar10 = CBaseEdict::GetChangeAccessor(pCVar7);
*(undefined2 *)(iVar10 + 2) = 0;
}
}
else {
*(byte *)(iVar17 + 0x70) = *(byte *)(iVar17 + 0x70) | 1;
}
*(CPointSpotlight *)(iVar17 + 0x126) = CVar4;
}
iVar17 = *(int *)(this + 0x468);
iVar10 = 0;
local_e0 = g_pEntityList;
uVar12 = *(uint *)(this + 0x46c);
if (((uVar12 != 0xffffffff) &&
(puVar16 = g_pEntityList + (uVar12 & 0xfff) * 0x10, puVar16 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar16 + 8) == uVar12 >> 0xc)) {
iVar10 = *(int *)(puVar16 + 4);
}
if (iVar17 == *(int *)(iVar10 + 0x454)) {
}
else {
if (*(char *)(iVar10 + 0x6c) == '\0') {
pCVar7 = *(CBaseEdict **)(iVar10 + 0x30);
if (pCVar7 != (CBaseEdict *)0x0) {
*(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
iVar11 = CBaseEdict::GetChangeAccessor(pCVar7);
*(undefined2 *)(iVar11 + 2) = 0;
local_e0 = g_pEntityList;
}
}
else {
*(byte *)(iVar10 + 0x70) = *(byte *)(iVar10 + 0x70) | 1;
}
*(int *)(iVar10 + 0x454) = iVar17;
uVar12 = *(uint *)(this + 0x46c);
}
iVar17 = 0;
fVar19 = *(float *)(this + 0x480);
if (((uVar12 != 0xffffffff) &&
(puVar16 = local_e0 + (uVar12 & 0xfff) * 0x10, puVar16 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar16 + 8) == uVar12 >> 0xc)) {
iVar17 = *(int *)(puVar16 + 4);
}
if (fVar19 != *(float *)(iVar17 + 0x4bc)) {
if (*(char *)(iVar17 + 0x6c) == '\0') {
pCVar7 = *(CBaseEdict **)(iVar17 + 0x30);
if (pCVar7 != (CBaseEdict *)0x0) {
*(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
iVar10 = CBaseEdict::GetChangeAccessor(pCVar7);
*(undefined2 *)(iVar10 + 2) = 0;
local_e0 = g_pEntityList;
}
}
else {
*(byte *)(iVar17 + 0x70) = *(byte *)(iVar17 + 0x70) | 1;
}
*(float *)(iVar17 + 0x4bc) = fVar19;
uVar12 = *(uint *)(this + 0x46c);
}
iVar17 = 0;
fVar19 = *(float *)(this + 0x47c);
if (((uVar12 != 0xffffffff) &&
(puVar16 = local_e0 + (uVar12 & 0xfff) * 0x10, puVar16 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar16 + 8) == uVar12 >> 0xc)) {
iVar17 = *(int *)(puVar16 + 4);
}
if (102.3 <= fVar19) {
fVar19 = 102.3;
}
if (fVar19 != *(float *)(iVar17 + 0x4b4)) {
if (*(char *)(iVar17 + 0x6c) == '\0') {
pCVar7 = *(CBaseEdict **)(iVar17 + 0x30);
if (pCVar7 != (CBaseEdict *)0x0) {
*(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
iVar10 = CBaseEdict::GetChangeAccessor(pCVar7);
*(undefined2 *)(iVar10 + 2) = 0;
local_e0 = g_pEntityList;
}
}
else {
*(byte *)(iVar17 + 0x70) = *(byte *)(iVar17 + 0x70) | 1;
}
*(float *)(iVar17 + 0x4b4) = fVar19;
uVar12 = *(uint *)(this + 0x46c);
}
pCVar14 = (CBeam *)0x0;
if (((uVar12 != 0xffffffff) &&
(local_e0 = local_e0 + (uVar12 & 0xfff) * 0x10, local_e0 != (undefined *)0xfffffffc)) &&
(*(uint *)(local_e0 + 8) == uVar12 >> 0xc)) {
pCVar14 = *(CBeam **)(local_e0 + 4);
}
iVar17 = 0;
CBeam::SetBeamFlags(pCVar14,0x280);
puVar16 = g_pEntityList;
uVar12 = *(uint *)(this + 0x46c);
if (((uVar12 != 0xffffffff) &&
(puVar15 = g_pEntityList + (uVar12 & 0xfff) * 0x10, puVar15 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar15 + 8) == uVar12 >> 0xc)) {
iVar17 = *(int *)(puVar15 + 4);
}
if (*(char *)(iVar17 + 0x127) != '@') {
if (*(char *)(iVar17 + 0x6c) == '\0') {
pCVar7 = *(CBaseEdict **)(iVar17 + 0x30);
if (pCVar7 != (CBaseEdict *)0x0) {
*(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
iVar10 = CBaseEdict::GetChangeAccessor(pCVar7);
*(undefined2 *)(iVar10 + 2) = 0;
puVar16 = g_pEntityList;
}
}
else {
*(byte *)(iVar17 + 0x70) = *(byte *)(iVar17 + 0x70) | 1;
}
*(undefined1 *)(iVar17 + 0x127) = 0x40;
uVar12 = *(uint *)(this + 0x46c);
}
iVar17 = 0;
if (((uVar12 != 0xffffffff) &&
(puVar15 = puVar16 + (uVar12 & 0xfff) * 0x10, puVar15 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar15 + 8) == uVar12 >> 0xc)) {
iVar17 = *(int *)(puVar15 + 4);
}
if (*(float *)(iVar17 + 0x4c0) != 0.0) {
if (*(char *)(iVar17 + 0x6c) == '\0') {
pCVar7 = *(CBaseEdict **)(iVar17 + 0x30);
if (pCVar7 != (CBaseEdict *)0x0) {
*(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
iVar10 = CBaseEdict::GetChangeAccessor(pCVar7);
*(undefined2 *)(iVar10 + 2) = 0;
puVar16 = g_pEntityList;
}
}
else {
*(byte *)(iVar17 + 0x70) = *(byte *)(iVar17 + 0x70) | 1;
}
*(undefined4 *)(iVar17 + 0x4c0) = 0;
}
pCVar13 = (CBaseEntity *)0x0;
uVar12 = *(uint *)(this + 0x470);
if (this[0x441] == (CPointSpotlight)0x0) {
if (((uVar12 != 0xffffffff) &&
(puVar15 = puVar16 + (uVar12 & 0xfff) * 0x10, puVar15 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar15 + 8) == uVar12 >> 0xc)) {
pCVar13 = *(CBaseEntity **)(puVar15 + 4);
}
uVar12 = *(uint *)(this + 0x46c);
pCVar14 = (CBeam *)0x0;
if (((uVar12 != 0xffffffff) &&
(puVar16 = puVar16 + (uVar12 & 0xfff) * 0x10, puVar16 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar16 + 8) == uVar12 >> 0xc)) {
pCVar14 = *(CBeam **)(puVar16 + 4);
}
CBeam::EntsInit(pCVar14,(CBaseEntity *)this,pCVar13);
}
else {
if (((uVar12 != 0xffffffff) &&
(puVar16 = puVar16 + (uVar12 & 0xfff) * 0x10, puVar16 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar16 + 8) == uVar12 >> 0xc)) {
pCVar13 = *(CBaseEntity **)(puVar16 + 4);
}
if (((byte)pCVar13[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar13);
}
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
uVar12 = *(uint *)(this + 0x46c);
pCVar14 = (CBeam *)0x0;
if (((uVar12 != 0xffffffff) &&
(puVar16 = g_pEntityList + (uVar12 & 0xfff) * 0x10, puVar16 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar16 + 8) == uVar12 >> 0xc)) {
pCVar14 = *(CBeam **)(puVar16 + 4);
}
CBeam::PointsInit(pCVar14,(Vector *)(this + 0x2e0),(Vector *)(pCVar13 + 0x2e0));
}
COutputEvent::FireOutput
((COutputEvent *)(this + 0x488),(CBaseEntity *)this,(CBaseEntity *)this,0.0);
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.