L L4D2node

CBaseCombatCharacter::Weapon_CanUse

0x005ef660 · 132 bytes · __thiscall

_ZN20CBaseCombatCharacter13Weapon_CanUseEP17CBaseCombatWeapon

Decompiled

undefined (2 params)

/* CBaseCombatCharacter::Weapon_CanUse(CBaseCombatWeapon*) */

undefined4 __thiscall
CBaseCombatCharacter::Weapon_CanUse(CBaseCombatCharacter *this,CBaseCombatWeapon *param_1)

{
  int iVar1;
  int iVar2;
  undefined4 uVar3;
  int iVar4;
  int iVar5;
  
  iVar1 = (**(code **)(*(int *)param_1 + 0x594))(param_1);
  iVar5 = 0;
  iVar2 = (**(code **)(*(int *)param_1 + 0x598))(param_1);
  if (iVar2 < 1) {
    return 0;
  }
  do {
    if (*(char *)(iVar1 + 8) != '\0') {
      uVar3 = (**(code **)(*(int *)this + 0x454))(this,*(undefined4 *)(iVar1 + 4));
      iVar4 = (**(code **)(*(int *)this + 0x340))(this,uVar3);
      if (iVar4 == -1) {
        return 0;
      }
    }
    iVar5 = iVar5 + 1;
    iVar1 = iVar1 + 0xc;
  } while (iVar5 != iVar2);
  return 1;
}

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)