L L4D2node

CWeaponSpawn::CWeaponSpawn

0x008d7550 · 482 bytes · __thiscall

_ZN12CWeaponSpawnC2Ev

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CWeaponSpawn::CWeaponSpawn() */

void __thiscall CWeaponSpawn::CWeaponSpawn(CWeaponSpawn *this)

{
  CBaseEdict *pCVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  
  CItem::CItem((CItem *)this);
  *(undefined ***)this = &PTR__CWeaponSpawn_00cef268;
  *(undefined ***)(this + 0x13f4) = &PTR_OnAttemptPhysGunPickup_00cef660;
  iVar3 = DAT_0100486c;
  *(undefined **)(this + 0x1448) = &DAT_00cef690;
  iVar2 = iVar3 + 1;
  if ((iVar2 <= DAT_01004864) || (DAT_01004868 < 0)) goto LAB_008d7595;
  if (DAT_01004868 == 0) {
    iVar4 = DAT_01004864;
    if (DAT_01004864 == 0) {
      if (iVar2 < 9) {
        DAT_01004864 = 8;
        goto LAB_008d761f;
      }
      iVar4 = 8;
    }
    do {
      DAT_01004864 = iVar4 * 2;
      if (iVar2 <= DAT_01004864) break;
      DAT_01004864 = iVar4 * 4;
      iVar4 = DAT_01004864;
    } while (DAT_01004864 < iVar2);
  }
  else {
    for (DAT_01004864 = (iVar3 / DAT_01004868 + 1) * DAT_01004868; DAT_01004864 < iVar2;
        DAT_01004864 = (DAT_01004864 + iVar2) / 2) {
    }
  }
LAB_008d761f:
  if (TheWeaponSpawns == (void *)0x0) {
    TheWeaponSpawns = malloc(DAT_01004864 << 2);
  }
  else {
    TheWeaponSpawns = realloc(TheWeaponSpawns,DAT_01004864 << 2);
    iVar2 = DAT_0100486c + 1;
  }
LAB_008d7595:
  iVar4 = iVar3 * 4;
  iVar3 = (iVar2 - iVar3) + -1;
  DAT_0100486c = iVar2;
  _DAT_01004870 = TheWeaponSpawns;
  if (0 < iVar3) {
    _V_memmove((void *)((int)TheWeaponSpawns + iVar4 + 4),(void *)((int)TheWeaponSpawns + iVar4),
               iVar3 * 4);
  }
  if ((undefined4 *)(iVar4 + (int)TheWeaponSpawns) != (undefined4 *)0x0) {
    *(undefined4 *)(iVar4 + (int)TheWeaponSpawns) = this;
  }
  if (*(int *)(this + 0x1458) != 0) {
    if (this[0x6c] == (CWeaponSpawn)0x0) {
      pCVar1 = *(CBaseEdict **)(this + 0x30);
      if (pCVar1 != (CBaseEdict *)0x0) {
        *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
        iVar2 = CBaseEdict::GetChangeAccessor(pCVar1);
        *(undefined2 *)(iVar2 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CWeaponSpawn)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x1458) = 0;
  }
  this[0x1464] = (CWeaponSpawn)0x0;
  *(undefined4 *)(this + 0x1450) = 0xffffffff;
  if (*(float *)(this + 0x145c) == 0.0) {
    return;
  }
  if (this[0x6c] == (CWeaponSpawn)0x0) {
    pCVar1 = *(CBaseEdict **)(this + 0x30);
    if (pCVar1 != (CBaseEdict *)0x0) {
      *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
                    /* try { // try from 008d7672 to 008d76d2 has its CatchHandler @ 008d775c */
      iVar2 = CBaseEdict::GetChangeAccessor(pCVar1);
      *(undefined2 *)(iVar2 + 2) = 0;
    }
    *(undefined4 *)(this + 0x145c) = 0;
  }
  else {
    this[0x70] = (CWeaponSpawn)((byte)this[0x70] | 1);
    *(undefined4 *)(this + 0x145c) = 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)