L L4D2node

CBaseCombatCharacter::Weapon_OwnsThisType

0x003fe6a0 · 248 bytes · __thiscall

_ZNK20CBaseCombatCharacter19Weapon_OwnsThisTypeEPKci

Decompiled

undefined (3 params)

/* CBaseCombatCharacter::Weapon_OwnsThisType(char const*, int) const */

undefined4 __thiscall
CBaseCombatCharacter::Weapon_OwnsThisType(CBaseCombatCharacter *this,char *param_1,int param_2)

{
  uint uVar1;
  CBaseEntity *this_00;
  char cVar2;
  int *piVar3;
  int iVar4;
  undefined4 *puVar5;
  uint uVar6;
  undefined *puVar7;
  CBaseCombatCharacter *pCVar8;
  int iVar9;
  
  iVar9 = 0;
  pCVar8 = this + 0x18f4;
  do {
    uVar1 = *(uint *)pCVar8;
    if (uVar1 != 0xffffffff) {
      uVar6 = uVar1 & 0xfff;
      puVar5 = (undefined4 *)(g_pEntityList + uVar6 * 0x10 + 4);
      if (((puVar5 != (undefined4 *)0x0) &&
          (*(uint *)(g_pEntityList + uVar6 * 0x10 + 8) == uVar1 >> 0xc)) &&
         (this_00 = *(CBaseEntity **)(g_pEntityList + uVar6 * 0x10 + 4),
         this_00 != (CBaseEntity *)0x0)) {
        if (param_1 == *(char **)(this_00 + 0x7c)) {
LAB_003fe790:
          piVar3 = (int *)*puVar5;
        }
        else {
          cVar2 = CBaseEntity::ClassMatchesComplex(this_00,param_1);
          if (cVar2 == '\0') goto LAB_003fe6c0;
          uVar1 = *(uint *)pCVar8;
          piVar3 = (int *)0x0;
          if (((uVar1 != 0xffffffff) &&
              (puVar5 = (undefined4 *)(g_pEntityList + (uVar1 & 0xfff) * 0x10 + 4),
              puVar5 != (undefined4 *)0x0)) && (puVar5[1] == uVar1 >> 0xc)) goto LAB_003fe790;
        }
        iVar4 = (**(code **)(*piVar3 + 0x3a8))(piVar3);
        if (iVar4 == param_2) {
          uVar1 = *(uint *)pCVar8;
          if (uVar1 == 0xffffffff) {
            return 0;
          }
          puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10;
          if (puVar7 == (undefined *)0xfffffffc) {
            return 0;
          }
          if (*(uint *)(puVar7 + 8) != uVar1 >> 0xc) {
            return 0;
          }
          return *(undefined4 *)(puVar7 + 4);
        }
      }
    }
LAB_003fe6c0:
    iVar9 = iVar9 + 1;
    pCVar8 = pCVar8 + 4;
    if (iVar9 == 0x38) {
      return 0;
    }
  } while( true );
}

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)