L L4D2node

CTerrorGun::Spawn

0x00564810 · 495 bytes · __thiscall

_ZN10CTerrorGun5SpawnEv

Decompiled

undefined (1 param)

/* CTerrorGun::Spawn() */

void __thiscall CTerrorGun::Spawn(CTerrorGun *this)

{
  CBaseEdict *pCVar1;
  CTerrorGun CVar2;
  int iVar3;
  
  if (this[0x17e0] != (CTerrorGun)0x0) {
    if (this[0x6c] == (CTerrorGun)0x0) {
      pCVar1 = *(CBaseEdict **)(this + 0x30);
      if (pCVar1 != (CBaseEdict *)0x0) {
        *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CTerrorGun)((byte)this[0x70] | 1);
    }
    this[0x17e0] = (CTerrorGun)0x0;
  }
  if (this[0x17e1] != (CTerrorGun)0x0) {
    if (this[0x6c] == (CTerrorGun)0x0) {
      pCVar1 = *(CBaseEdict **)(this + 0x30);
      if (pCVar1 != (CBaseEdict *)0x0) {
        *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CTerrorGun)((byte)this[0x70] | 1);
    }
    this[0x17e1] = (CTerrorGun)0x0;
  }
  CVar2 = (CTerrorGun)(**(code **)(*(int *)this + 0x704))(this);
  *(undefined4 *)(this + 0x17f0) = 0;
  this[0x145d] = CVar2;
  if (*(int *)(this + 0x17dc) != 0) {
    if (this[0x6c] == (CTerrorGun)0x0) {
      pCVar1 = *(CBaseEdict **)(this + 0x30);
      if (pCVar1 != (CBaseEdict *)0x0) {
        *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CTerrorGun)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x17dc) = 0;
  }
  if (this[0x17e3] != (CTerrorGun)0x0) {
    if (this[0x6c] == (CTerrorGun)0x0) {
      pCVar1 = *(CBaseEdict **)(this + 0x30);
      if (pCVar1 != (CBaseEdict *)0x0) {
        *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CTerrorGun)((byte)this[0x70] | 1);
    }
    this[0x17e3] = (CTerrorGun)0x0;
  }
  *(undefined4 *)(this + 0x17e8) = 0;
  CTerrorWeapon::Spawn((CTerrorWeapon *)this);
  if ((this[0x17e2] == (CTerrorGun)0x0) || (*(int *)(this + 0x1420) == 0)) {
    CVar2 = this[0x6c];
  }
  else {
    if (this[0x6c] == (CTerrorGun)0x0) {
      pCVar1 = *(CBaseEdict **)(this + 0x30);
      CVar2 = (CTerrorGun)0x0;
      if (pCVar1 != (CBaseEdict *)0x0) {
        *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
        *(undefined2 *)(iVar3 + 2) = 0;
        CVar2 = this[0x6c];
      }
    }
    else {
      this[0x70] = (CTerrorGun)((byte)this[0x70] | 1);
      CVar2 = (CTerrorGun)0x1;
    }
    *(undefined4 *)(this + 0x1420) = 0;
  }
  if (CVar2 == (CTerrorGun)0x0) {
    pCVar1 = *(CBaseEdict **)(this + 0x30);
    if (pCVar1 != (CBaseEdict *)0x0) {
      *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
      iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
      *(undefined2 *)(iVar3 + 2) = 0;
    }
    *(undefined4 *)(this + 0x17e4) = 0;
    return;
  }
  this[0x70] = (CTerrorGun)((byte)this[0x70] | 1);
  *(undefined4 *)(this + 0x17e4) = 0;
  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)