L L4D2node

CWeaponCSBase::CWeaponCSBase

0x00440010 · 379 bytes · __thiscall

_ZN13CWeaponCSBaseC1Ev

Decompiled

undefined (1 param)

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

void __thiscall CWeaponCSBase::CWeaponCSBase(CWeaponCSBase *this)

{
  int iVar1;
  int iVar2;
  int iVar3;
  
  CBaseCombatWeapon::CBaseCombatWeapon((CBaseCombatWeapon *)this);
  *(undefined ***)this = &PTR__CWeaponCSBase_00c10768;
                    /* try { // try from 00440035 to 00440149 has its CatchHandler @ 0044019c */
  CBaseEntity::SetPredictionEligible(SUB41(this,0));
  this[0x14f0] = (CWeaponCSBase)0x1;
  *(undefined4 *)(this + 0x1500) = 0;
  *(undefined4 *)(this + 0x1504) = 0;
  CCollisionProperty::SetSolidFlags
            ((CCollisionProperty *)(this + 0x194),(uint)(*(ushort *)(this + 0x1b4) | 8));
  *(undefined4 *)(this + 0x1508) = 0;
  iVar2 = DAT_00f78ecc;
  iVar1 = DAT_00f78ecc + 1;
  if ((iVar1 <= DAT_00f78ec4) || (DAT_00f78ec8 < 0)) goto LAB_00440095;
  if (DAT_00f78ec8 == 0) {
    iVar3 = DAT_00f78ec4;
    if (DAT_00f78ec4 == 0) {
      if (iVar1 < 9) {
        DAT_00f78ec4 = 8;
        goto LAB_004400ff;
      }
      iVar3 = 8;
    }
    do {
      DAT_00f78ec4 = iVar3 * 2;
      if (iVar1 <= DAT_00f78ec4) break;
      DAT_00f78ec4 = iVar3 * 4;
      iVar3 = DAT_00f78ec4;
    } while (DAT_00f78ec4 < iVar1);
  }
  else {
    for (DAT_00f78ec4 = (DAT_00f78ecc / DAT_00f78ec8 + 1) * DAT_00f78ec8; DAT_00f78ec4 < iVar1;
        DAT_00f78ec4 = (DAT_00f78ec4 + iVar1) / 2) {
    }
  }
LAB_004400ff:
  if (TheWeapons == (void *)0x0) {
    TheWeapons = malloc(DAT_00f78ec4 << 2);
  }
  else {
    TheWeapons = realloc(TheWeapons,DAT_00f78ec4 << 2);
    iVar1 = DAT_00f78ecc + 1;
  }
LAB_00440095:
  iVar3 = iVar2 * 4;
  iVar2 = (iVar1 - iVar2) + -1;
  DAT_00f78ecc = iVar1;
  _DAT_00f78ed0 = TheWeapons;
  if (0 < iVar2) {
    _V_memmove((void *)((int)TheWeapons + iVar3 + 4),(void *)((int)TheWeapons + iVar3),iVar2 * 4);
  }
  if ((undefined4 *)(iVar3 + (int)TheWeapons) != (undefined4 *)0x0) {
    *(undefined4 *)(iVar3 + (int)TheWeapons) = this;
  }
  this[0x150c] = (CWeaponCSBase)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)