L L4D2node

CPointSpotlight::Spawn

0x007dc520 · 613 bytes · __thiscall

_ZN15CPointSpotlight5SpawnEv

Decompiled

undefined (1 param)

/* CPointSpotlight::Spawn() */

void __thiscall CPointSpotlight::Spawn(CPointSpotlight *this)

{
  float fVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined1 *puVar5;
  undefined1 local_14 [12];
  
  (**(code **)(*(int *)this + 0x6c))(this);
  UTIL_SetSize((CBaseEntity *)this,(Vector *)&vec3_origin,(Vector *)&vec3_origin);
  CCollisionProperty::SetSolidFlags
            ((CCollisionProperty *)(this + 0x194),(uint)(*(ushort *)(this + 0x1b4) | 4));
  CBaseEntity::SetMoveType((CBaseEntity *)this,0,0);
  this[0x441] = (CPointSpotlight)0x1;
  if (*(float *)(this + 0x474) <= 0.0) {
    uVar4 = CBaseEntity::GetDebugName((CBaseEntity *)this);
    puVar5 = &DAT_00d539c2;
    if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
      puVar5 = *(undefined1 **)(this + 0x7c);
    }
    DevMsg("%s (%s) has an invalid spotlight length <= 0, setting to 500\n",puVar5,uVar4);
    *(undefined4 *)(this + 0x474) = 0x43fa0000;
  }
  fVar1 = *(float *)(this + 0x47c);
  if (fVar1 <= 0.0) {
    uVar4 = CBaseEntity::GetDebugName((CBaseEntity *)this);
    puVar5 = &DAT_00d539c2;
    if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
      puVar5 = *(undefined1 **)(this + 0x7c);
    }
    DevMsg("%s (%s) has an invalid spotlight width <= 0, setting to 10\n",puVar5,uVar4);
    *(undefined4 *)(this + 0x47c) = 0x41200000;
  }
  else if (102.3 < fVar1) {
    uVar4 = CBaseEntity::GetDebugName((CBaseEntity *)this);
    puVar5 = &DAT_00d539c2;
    if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
      puVar5 = *(undefined1 **)(this + 0x7c);
    }
    DevMsg("%s (%s) has an invalid spotlight width %.1f (max %.1f).\n",puVar5,uVar4,(double)fVar1,
           0x4059933340000000);
    *(undefined4 *)(this + 0x47c) = 0x42cc999a;
  }
  *(undefined4 *)(this + 0x46c) = 0xffffffff;
  uVar3 = DAT_01053d50;
  *(undefined4 *)(this + 0x470) = 0xffffffff;
  uVar4 = vec3_origin;
  *(undefined4 *)(this + 0x44c) = uVar3;
  uVar2 = DAT_01053d4c;
  *(undefined4 *)(this + 0x458) = uVar3;
  this[0x440] = (CPointSpotlight)((byte)*(undefined4 *)(this + 0x148) & 1);
  this[0x440] = (CPointSpotlight)((byte)this[0x440] & 1);
  *(undefined4 *)(this + 0x464) = uVar3;
  *(undefined4 *)(this + 0x444) = uVar4;
  *(undefined4 *)(this + 0x448) = uVar2;
  *(undefined4 *)(this + 0x450) = uVar4;
  *(undefined4 *)(this + 0x454) = uVar2;
  *(undefined4 *)(this + 0x45c) = uVar4;
  *(undefined4 *)(this + 0x460) = uVar2;
  *(undefined4 *)(this + 0x478) = *(undefined4 *)(this + 0x474);
  CBaseEntity::ThinkSet((_func_void *)local_14,(float)this,(char *)SpotlightThink);
  CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 0.1,(char *)0x0);
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)