L L4D2node

CWeaponCSBase::Drop

0x00440a00 · 658 bytes · __thiscall

_ZN13CWeaponCSBase4DropERK6Vector

Decompiled

undefined (2 params)

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

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

{
  int *piVar1;
  CBaseEdict *this_00;
  int iVar2;
  CBaseEdict *pCVar3;
  undefined4 uVar4;
  uint uVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  undefined4 uVar8;
  undefined1 local_24 [12];
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  
  this[0x1458] = (CWeaponCSBase)0x1;
  if (*(float *)(this + 0x468) != 0.0) {
    if (this[0x6c] == (CWeaponCSBase)0x0) {
      pCVar3 = *(CBaseEdict **)(this + 0x30);
      if (pCVar3 != (CBaseEdict *)0x0) {
        *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
        iVar2 = CBaseEdict::GetChangeAccessor(pCVar3);
        *(undefined2 *)(iVar2 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CWeaponCSBase)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x468) = 0;
  }
  CBaseEntity::StopFollowingEntity((CBaseEntity *)this);
  CBaseEntity::SetMoveType((CBaseEntity *)this,6,0);
  *(undefined4 *)(this + 0x2c0) = 0x3f800000;
  if (*(int *)(this + 0x1414) == 0) {
    pCVar3 = *(CBaseEdict **)(this + 0x30);
  }
  else {
    if (this[0x6c] == (CWeaponCSBase)0x0) {
      this_00 = *(CBaseEdict **)(this + 0x30);
      pCVar3 = (CBaseEdict *)0x0;
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
        iVar2 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar2 + 2) = 0;
        pCVar3 = *(CBaseEdict **)(this + 0x30);
      }
    }
    else {
      this[0x70] = (CWeaponCSBase)((byte)this[0x70] | 1);
      pCVar3 = *(CBaseEdict **)(this + 0x30);
    }
    *(undefined4 *)(this + 0x1414) = 0;
  }
  uVar5 = *(uint *)(this + 0xd4) & 0xffffffdf;
  if (*(uint *)(this + 0xd4) != uVar5) {
    if (this[0x6c] == (CWeaponCSBase)0x0) {
      if (pCVar3 != (CBaseEdict *)0x0) {
        *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
        iVar2 = CBaseEdict::GetChangeAccessor(pCVar3);
        *(undefined2 *)(iVar2 + 2) = 0;
        pCVar3 = *(CBaseEdict **)(this + 0x30);
      }
    }
    else {
      this[0x70] = (CWeaponCSBase)((byte)this[0x70] | 1);
    }
    *(uint *)(this + 0xd4) = uVar5;
  }
  if (pCVar3 != (CBaseEdict *)0x0) {
    *(uint *)pCVar3 = *(uint *)pCVar3 | 0x80;
  }
  CBaseEntity::DispatchUpdateTransmitState((CBaseEntity *)this);
  (**(code **)(*(int *)this + 0x5a4))(this);
  CBaseEntity::SetGroundEntity((CBaseEntity *)this,(CBaseEntity *)0x0);
  if (this[0x1459] != (CWeaponCSBase)0x0) {
    if (this[0x6c] == (CWeaponCSBase)0x0) {
      pCVar3 = *(CBaseEdict **)(this + 0x30);
      if (pCVar3 != (CBaseEdict *)0x0) {
        *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
        iVar2 = CBaseEdict::GetChangeAccessor(pCVar3);
        *(undefined2 *)(iVar2 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CWeaponCSBase)((byte)this[0x70] | 1);
    }
    this[0x1459] = (CWeaponCSBase)0x0;
  }
  uVar8 = 0;
  uVar7 = 0;
  uVar6 = 0;
  CBaseEntity::ThinkSet((_func_void *)local_24,(float)this,(char *)0x0);
  *(float *)(this + 0x1500) = *(float *)(gpGlobals + 0xc) + 0.8;
  uVar4 = GetPlayerOwner(this);
  *(undefined4 *)(this + 0xd8) = 0x3d1;
  *(undefined4 *)(this + 0x1504) = uVar4;
  piVar1 = *(int **)(this + 0x238);
  *(undefined4 *)(this + 0xdc) = 0;
  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,uVar6,uVar7,uVar8);
  }
  CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc),(char *)0x0);
  (**(code **)(*(int *)this + 0x50))(this,0);
  CBaseCombatWeapon::SetOwner((CBaseCombatWeapon *)this,(CBaseCombatCharacter *)0x0);
  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)