L L4D2node

CBaseCombatWeapon::GetAvailableWeaponsInBox

0x00409d90 · 157 bytes · __cdecl

_ZN17CBaseCombatWeapon24GetAvailableWeaponsInBoxEPPS_iRK6VectorS4_

Decompiled

undefined (4 params)

/* CBaseCombatWeapon::GetAvailableWeaponsInBox(CBaseCombatWeapon**, int, Vector const&, Vector
   const&) */

int CBaseCombatWeapon::GetAvailableWeaponsInBox
              (CBaseCombatWeapon **param_1,int param_2,Vector *param_3,Vector *param_4)

{
  CBaseCombatWeapon *this;
  char cVar1;
  uint uVar2;
  int iVar3;
  int iVar4;
  
  uVar2 = (uint)(ushort)g_WeaponList._24_2_;
  if (uVar2 == 0xffff) {
    iVar4 = 0;
  }
  else {
    iVar4 = 0;
    do {
      this = *(CBaseCombatWeapon **)(g_WeaponList._12_4_ + uVar2 * 8);
      iVar3 = GetOwner(this);
      if (iVar3 == 0) {
        if (((byte)this[0x14d] & 8) != 0) {
          CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
        }
        cVar1 = IsPointInBox((Vector *)(this + 0x2e0),param_3,param_4);
        if ((cVar1 != '\0') && (iVar4 < param_2)) {
          param_1[iVar4] = this;
          iVar4 = iVar4 + 1;
        }
      }
      uVar2 = (uint)*(ushort *)(g_WeaponList._12_4_ + 6 + uVar2 * 8);
    } while (uVar2 != 0xffff);
  }
  return iVar4;
}

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)