L L4D2node

CBaseCSGrenade::DropGrenade

0x0043cfc0 · 576 bytes · __thiscall

_ZN14CBaseCSGrenade11DropGrenadeEv

Decompiled

undefined (1 param)

/* CBaseCSGrenade::DropGrenade() */

void __thiscall CBaseCSGrenade::DropGrenade(CBaseCSGrenade *this)

{
  code *pcVar1;
  CBaseEdict *pCVar2;
  char cVar3;
  CBasePlayer *this_00;
  float *pfVar4;
  uint uVar5;
  int iVar6;
  float local_4c;
  float local_48;
  float local_44;
  float local_40;
  float local_3c;
  float local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  float local_24;
  undefined4 local_20;
  
  this_00 = (CBasePlayer *)CBaseCombatWeapon::GetOwner((CBaseCombatWeapon *)this);
  if (this_00 != (CBasePlayer *)0x0) {
    cVar3 = (**(code **)(*(int *)this_00 + 0x16c))(this_00);
    if (cVar3 != '\0') {
      CBasePlayer::EyeVectors(this_00,(Vector *)&local_4c,(Vector *)0x0,(Vector *)0x0);
      pfVar4 = (float *)(**(code **)(*(int *)this_00 + 0x250))(this_00);
      uVar5 = *(uint *)(this_00 + 0x14c);
      if ((uVar5 & 0x800) != 0) {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this_00);
        uVar5 = *(uint *)(this_00 + 0x14c);
      }
      local_3c = pfVar4[1] + *(float *)(this_00 + 0x2e4) + local_48 * 16.0;
      local_38 = pfVar4[2] + *(float *)(this_00 + 0x2e8) + local_44 * 16.0;
      local_40 = *pfVar4 + *(float *)(this_00 + 0x2e0) + local_4c * 16.0;
      if ((uVar5 & 0x1000) != 0) {
        CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this_00);
      }
      local_34 = *(undefined4 *)(this_00 + 0x274);
      local_30 = *(undefined4 *)(this_00 + 0x278);
      local_2c = *(undefined4 *)(this_00 + 0x27c);
      pcVar1 = *(code **)(*(int *)this + 0x714);
      iVar6 = (**(code **)(*random_valve + 8))(random_valve,0xfffffb50,0x4b0);
      local_28 = 0x44160000;
      local_24 = (float)iVar6;
      local_20 = 0;
      (*pcVar1)(this,local_40,local_3c,local_38,vec3_angle,DAT_01053d40,DAT_01053d44,local_34,
                local_30,local_2c,0x44160000,local_24,0,this_00);
      if (this[0x17dc] != (CBaseCSGrenade)0x1) {
        if (this[0x6c] == (CBaseCSGrenade)0x0) {
          pCVar2 = *(CBaseEdict **)(this + 0x30);
          if (pCVar2 != (CBaseEdict *)0x0) {
            *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
            iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
            *(undefined2 *)(iVar6 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CBaseCSGrenade)((byte)this[0x70] | 1);
        }
        this[0x17dc] = (CBaseCSGrenade)0x1;
      }
      if (*(float *)(this + 0x17e0) != 0.0) {
        if (this[0x6c] == (CBaseCSGrenade)0x0) {
          pCVar2 = *(CBaseEdict **)(this + 0x30);
          if (pCVar2 != (CBaseEdict *)0x0) {
            *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
            iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
            *(undefined2 *)(iVar6 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CBaseCSGrenade)((byte)this[0x70] | 1);
        }
        *(undefined4 *)(this + 0x17e0) = 0;
      }
    }
  }
  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)