L L4D2node

CBaseCombatWeapon::Drop

0x00407c00 · 936 bytes · __thiscall

_ZN17CBaseCombatWeapon4DropERK6Vector

Decompiled

undefined (2 params)

/* CBaseCombatWeapon::Drop(Vector const&) */

void __thiscall CBaseCombatWeapon::Drop(CBaseCombatWeapon *this,Vector *param_1)

{
  int *piVar1;
  CBaseEdict *this_00;
  undefined4 uVar2;
  char cVar3;
  int iVar4;
  CBaseEdict *pCVar5;
  undefined *puVar6;
  uint uVar7;
  undefined4 uVar8;
  undefined4 uVar9;
  undefined4 uVar10;
  undefined1 local_24 [12];
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  
  this[0x1458] = (CBaseCombatWeapon)0x1;
  WeaponManager_AmmoMod(this);
  uVar7 = *(uint *)(this + 0x148) | 0x40000000;
  if (*(uint *)(this + 0x148) != uVar7) {
    if (this[0x6c] == (CBaseCombatWeapon)0x0) {
      pCVar5 = *(CBaseEdict **)(this + 0x30);
      if (pCVar5 != (CBaseEdict *)0x0) {
        *(uint *)pCVar5 = *(uint *)pCVar5 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(pCVar5);
        *(undefined2 *)(iVar4 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBaseCombatWeapon)((byte)this[0x70] | 1);
    }
    *(uint *)(this + 0x148) = uVar7;
  }
  if (*(float *)(this + 0x468) != 0.0) {
    if (this[0x6c] == (CBaseCombatWeapon)0x0) {
      pCVar5 = *(CBaseEdict **)(this + 0x30);
      if (pCVar5 != (CBaseEdict *)0x0) {
        *(uint *)pCVar5 = *(uint *)pCVar5 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(pCVar5);
        *(undefined2 *)(iVar4 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBaseCombatWeapon)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x468) = 0;
  }
  CBaseEntity::StopFollowingEntity((CBaseEntity *)this);
  CBaseEntity::SetMoveType((CBaseEntity *)this,5,0);
  *(undefined4 *)(this + 0x2c0) = 0x3f800000;
  if (*(int *)(this + 0x1414) == 0) {
    pCVar5 = *(CBaseEdict **)(this + 0x30);
  }
  else {
    if (this[0x6c] == (CBaseCombatWeapon)0x0) {
      this_00 = *(CBaseEdict **)(this + 0x30);
      pCVar5 = (CBaseEdict *)0x0;
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar4 + 2) = 0;
        pCVar5 = *(CBaseEdict **)(this + 0x30);
      }
    }
    else {
      this[0x70] = (CBaseCombatWeapon)((byte)this[0x70] | 1);
      pCVar5 = *(CBaseEdict **)(this + 0x30);
    }
    *(undefined4 *)(this + 0x1414) = 0;
  }
  uVar7 = *(uint *)(this + 0xd4) & 0xffffffdf;
  if (*(uint *)(this + 0xd4) != uVar7) {
    if (this[0x6c] == (CBaseCombatWeapon)0x0) {
      if (pCVar5 != (CBaseEdict *)0x0) {
        *(uint *)pCVar5 = *(uint *)pCVar5 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(pCVar5);
        *(undefined2 *)(iVar4 + 2) = 0;
        pCVar5 = *(CBaseEdict **)(this + 0x30);
      }
    }
    else {
      this[0x70] = (CBaseCombatWeapon)((byte)this[0x70] | 1);
    }
    *(uint *)(this + 0xd4) = uVar7;
  }
  if (pCVar5 != (CBaseEdict *)0x0) {
    *(uint *)pCVar5 = *(uint *)pCVar5 | 0x80;
  }
  CBaseEntity::DispatchUpdateTransmitState((CBaseEntity *)this);
  (**(code **)(*(int *)this + 0x5a4))(this);
  CBaseEntity::SetGroundEntity((CBaseEntity *)this,(CBaseEntity *)0x0);
  uVar10 = 0;
  uVar9 = 0;
  uVar8 = 0;
  CBaseEntity::ThinkSet((_func_void *)local_24,(float)this,(char *)0x3cd);
  uVar2 = hl2_episodic._28_4_;
  *(undefined4 *)(this + 0xd8) = 0;
  *(undefined4 *)(this + 0xdc) = 0;
  if ((*(int *)(uVar2 + 0x30) == 0) ||
     (uVar7 = *(uint *)(this + 0x148) & 0xfffffffd, *(uint *)(this + 0x148) == uVar7)) {
    piVar1 = *(int **)(this + 0x238);
  }
  else {
    if (this[0x6c] == (CBaseCombatWeapon)0x0) {
      pCVar5 = *(CBaseEdict **)(this + 0x30);
      if (pCVar5 != (CBaseEdict *)0x0) {
        *(uint *)pCVar5 = *(uint *)pCVar5 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(pCVar5);
        *(undefined2 *)(iVar4 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBaseCombatWeapon)((byte)this[0x70] | 1);
    }
    piVar1 = *(int **)(this + 0x238);
    *(uint *)(this + 0x148) = uVar7;
  }
  if (piVar1 == (int *)0x0) {
    CBaseEntity::SetAbsVelocity((CBaseEntity *)this,param_1);
  }
  else {
    local_18 = 0x43480000;
    local_14 = 0x43480000;
    local_10 = 0x43480000;
    (**(code **)(*piVar1 + 0xd8))(piVar1,param_1,&local_18,uVar8,uVar9,uVar10);
  }
  uVar7 = *(uint *)(this + 0x220);
  if (((uVar7 == 0xffffffff) ||
      (puVar6 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar6 + 8) != uVar7 >> 0xc)) {
    CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 1.0,(char *)0x0);
    (**(code **)(*(int *)this + 0x50))(this,0);
    SetOwner(this,(CBaseCombatCharacter *)0x0);
  }
  else {
    piVar1 = *(int **)(puVar6 + 4);
    CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 1.0,(char *)0x0);
    (**(code **)(*(int *)this + 0x50))(this,0);
    SetOwner(this,(CBaseCombatCharacter *)0x0);
    if (((piVar1 != (int *)0x0) && (cVar3 = (**(code **)(*piVar1 + 0x140))(piVar1), cVar3 != '\0'))
       && (cVar3 = (**(code **)(*g_pGameRules + 0xb0))(g_pGameRules,this), cVar3 == '\0')) {
      UTIL_Remove((CBaseEntity *)this);
      return;
    }
  }
  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)