L L4D2node

CMultiplayRules::CanHavePlayerItem

0x0046fdf0 · 157 bytes · __thiscall

_ZN15CMultiplayRules17CanHavePlayerItemEP11CBasePlayerP17CBaseCombatWeapon

Decompiled

undefined (3 params)

/* CMultiplayRules::CanHavePlayerItem(CBasePlayer*, CBaseCombatWeapon*) */

undefined4 __thiscall
CMultiplayRules::CanHavePlayerItem
          (CMultiplayRules *this,CBasePlayer *param_1,CBaseCombatWeapon *param_2)

{
  uint uVar1;
  undefined4 uVar2;
  undefined *puVar3;
  int iVar4;
  
  if (0 < *(int *)(weaponstay._28_4_ + 0x30)) {
    uVar1 = (**(code **)(*(int *)param_2 + 0x52c))(param_2);
    iVar4 = 0;
    if ((uVar1 & 8) == 0) {
      do {
        uVar1 = *(uint *)(param_1 + iVar4 * 4 + 0x18f4);
        if ((((uVar1 != 0xffffffff) &&
             (puVar3 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar3 != (undefined *)0xfffffffc))
            && (*(uint *)(puVar3 + 8) == uVar1 >> 0xc)) &&
           (param_2 == *(CBaseCombatWeapon **)(puVar3 + 4))) {
          return 0;
        }
        iVar4 = iVar4 + 1;
      } while (iVar4 != 0x38);
    }
  }
  uVar2 = CGameRules::CanHavePlayerItem((CBasePlayer *)this,(CBaseCombatWeapon *)param_1);
  return uVar2;
}

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)