L L4D2node

CStripWeapons::InputStripWeaponByClassname

0x007a8170 · 290 bytes · __thiscall

_ZN13CStripWeapons27InputStripWeaponByClassnameER11inputdata_t

Decompiled

undefined (2 params)

/* CStripWeapons::InputStripWeaponByClassname(inputdata_t&) */

void __thiscall CStripWeapons::InputStripWeaponByClassname(CStripWeapons *this,inputdata_t *param_1)

{
  int *piVar1;
  uint uVar2;
  CBaseEntity *pCVar3;
  char cVar4;
  char *pcVar5;
  char *pcVar6;
  int iVar7;
  undefined *puVar8;
  int iVar9;
  CBaseCombatCharacter *local_24;
  
  if (*(int *)(param_1 + 0x18) == 2) {
    pcVar5 = "";
    if (*(char **)(param_1 + 8) != (char *)0x0) {
      pcVar5 = *(char **)(param_1 + 8);
    }
  }
  else {
    pcVar5 = (char *)variant_t::ToString((variant_t *)(param_1 + 8));
    if (pcVar5 == (char *)0x0) {
      return;
    }
  }
  if (*pcVar5 != '\0') {
    piVar1 = *(int **)param_1;
    if ((piVar1 == (int *)0x0) || (cVar4 = (**(code **)(*piVar1 + 0x16c))(piVar1), cVar4 == '\0')) {
      cVar4 = (**(code **)(*g_pGameRules + 0xd0))(g_pGameRules);
      if (cVar4 != '\0') {
        return;
      }
      local_24 = (CBaseCombatCharacter *)UTIL_GetLocalPlayer();
    }
    else {
      local_24 = *(CBaseCombatCharacter **)param_1;
    }
    if (local_24 != (CBaseCombatCharacter *)0x0) {
      iVar9 = 0;
      do {
        uVar2 = *(uint *)(local_24 + iVar9 * 4 + 0x18f4);
        if ((((uVar2 != 0xffffffff) &&
             (puVar8 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc))
            && (*(uint *)(puVar8 + 8) == uVar2 >> 0xc)) &&
           (pCVar3 = *(CBaseEntity **)(puVar8 + 4), pCVar3 != (CBaseEntity *)0x0)) {
          pcVar6 = *(char **)(pCVar3 + 0x7c);
          if (pcVar6 == (char *)0x0) {
            pcVar6 = "";
          }
          iVar7 = _V_strcmp(pcVar6,pcVar5);
          if (iVar7 == 0) {
            CBaseCombatCharacter::Weapon_Detach(local_24,(CBaseCombatWeapon *)pCVar3);
            UTIL_Remove(pCVar3);
            return;
          }
        }
        iVar9 = iVar9 + 1;
      } while (iVar9 != 0x38);
    }
  }
  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)