L L4D2node

CPlayerPickupController::Shutdown

0x004ecfb0 · 503 bytes · __thiscall

_ZN23CPlayerPickupController8ShutdownEb

Decompiled

undefined (2 params)

/* CPlayerPickupController::Shutdown(bool) */

void __thiscall CPlayerPickupController::Shutdown(CPlayerPickupController *this,bool param_1)

{
  CBaseEdict *this_00;
  char cVar1;
  int *piVar2;
  undefined *puVar3;
  int iVar4;
  uint uVar5;
  
  uVar5 = *(uint *)(this + 0x24a8);
  if (((uVar5 == 0xffffffff) ||
      (puVar3 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar3 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar3 + 8) != uVar5 >> 0xc)) {
    iVar4 = 0;
LAB_004ecff2:
    CGrabController::DetachEntity((CGrabController *)(this + 0x440),false);
    if (iVar4 == 0) goto LAB_004ed027;
  }
  else {
    iVar4 = *(int *)(puVar3 + 4);
    if (((param_1) || (iVar4 == 0)) || (piVar2 = *(int **)(iVar4 + 0x238), piVar2 == (int *)0x0))
    goto LAB_004ecff2;
    cVar1 = (**(code **)(*piVar2 + 0x110))(piVar2,0,0);
    if (cVar1 == '\0') goto LAB_004ecff2;
    CGrabController::DetachEntity((CGrabController *)(this + 0x440),true);
  }
  Pickup_OnPhysGunDrop(iVar4,*(undefined4 *)(this + 0x24c4),param_1);
LAB_004ed027:
  piVar2 = *(int **)(this + 0x24c4);
  if (piVar2 != (int *)0x0) {
    uVar5 = piVar2[0x745];
    if (((uVar5 != 0xffffffff) &&
        (puVar3 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar3 != (undefined *)0xfffffffc)) &&
       ((*(uint *)(puVar3 + 8) == uVar5 >> 0xc && (*(int *)(puVar3 + 4) != 0)))) {
      if ((char)piVar2[0x1b] == '\0') {
        this_00 = (CBaseEdict *)piVar2[0xc];
        if (this_00 != (CBaseEdict *)0x0) {
          *(uint *)this_00 = *(uint *)this_00 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(this_00);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        *(byte *)(piVar2 + 0x1c) = *(byte *)(piVar2 + 0x1c) | 1;
      }
      piVar2[0x745] = -1;
    }
    (**(code **)(*piVar2 + 0x76c))(piVar2);
    iVar4 = CBaseCombatCharacter::GetActiveWeapon(*(CBaseCombatCharacter **)(this + 0x24c4));
    if (iVar4 != 0) {
      piVar2 = (int *)CBaseCombatCharacter::GetActiveWeapon
                                (*(CBaseCombatCharacter **)(this + 0x24c4));
      cVar1 = (**(code **)(*piVar2 + 0x424))(piVar2);
      if (cVar1 == '\0') {
        CBaseCombatCharacter::SwitchToNextBestWeapon
                  (*(CBaseCombatCharacter **)(this + 0x24c4),(CBaseCombatWeapon *)0x0);
      }
    }
    iVar4 = *(int *)(this + 0x24c4);
    uVar5 = *(uint *)(iVar4 + 0x1a7c) & 0xfffffffe;
    if (*(uint *)(iVar4 + 0x1a7c) != uVar5) {
      (**(code **)(*(int *)(iVar4 + 0x1a40) + 4))(iVar4 + 0x1a40,iVar4 + 0x1a7c);
      *(uint *)(iVar4 + 0x1a7c) = uVar5;
    }
  }
  CBaseEntity::Remove((CBaseEntity *)this);
  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)