L L4D2node

CBaseCSGrenadeProjectile::DangerSoundThink

0x0042c5b0 · 649 bytes · __thiscall

_ZN24CBaseCSGrenadeProjectile16DangerSoundThinkEv

Decompiled

undefined (1 param)

/* CBaseCSGrenadeProjectile::DangerSoundThink() */

void __thiscall CBaseCSGrenadeProjectile::DangerSoundThink(CBaseCSGrenadeProjectile *this)

{
  char cVar1;
  uint uVar2;
  int iVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  float local_18;
  float local_14;
  float local_10;
  
  cVar1 = CBaseEntity::IsInWorld((CBaseEntity *)this);
  if (cVar1 == '\0') {
    CBaseEntity::Remove((CBaseEntity *)this);
    return;
  }
  if (*(float *)(gpGlobals + 0xc) < *(float *)(this + 0x1a6c) ||
      *(float *)(gpGlobals + 0xc) == *(float *)(this + 0x1a6c)) {
    uVar2 = *(uint *)(this + 0x14c);
    if ((uVar2 & 0x1000) == 0) {
      fVar6 = *(float *)(this + 0x274);
      fVar5 = *(float *)(this + 0x278);
      fVar4 = *(float *)(this + 0x27c);
      iVar3 = (int)SQRT(fVar5 * fVar5 + fVar6 * fVar6 + fVar4 * fVar4);
    }
    else {
      CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this);
      fVar6 = *(float *)(this + 0x274);
      fVar4 = *(float *)(this + 0x27c);
      fVar5 = *(float *)(this + 0x278);
      uVar2 = *(uint *)(this + 0x14c);
      iVar3 = (int)SQRT(fVar6 * fVar6 + fVar4 * fVar4 + fVar5 * fVar5);
      if ((uVar2 & 0x1000) != 0) {
        CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this);
        fVar6 = *(float *)(this + 0x274);
        fVar5 = *(float *)(this + 0x278);
        fVar4 = *(float *)(this + 0x27c);
        uVar2 = *(uint *)(this + 0x14c);
      }
    }
    if ((uVar2 & 0x800) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    local_18 = fVar6 * 0.5 + *(float *)(this + 0x2e0);
    local_14 = fVar5 * 0.5 + *(float *)(this + 0x2e4);
    local_10 = fVar4 * 0.5 + *(float *)(this + 0x2e8);
    CSoundEnt::InsertSound(8,(Vector *)&local_18,iVar3,0.2,(CBaseEntity *)0x0,0,(CBaseEntity *)0x0);
    CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 0.2,(char *)0x0);
    if (this[0x253] != (CBaseCSGrenadeProjectile)0x0) {
      if (((byte)this[0x14d] & 0x10) != 0) {
        CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this);
      }
      local_18 = *(float *)(this + 0x274) * 0.5;
      local_14 = *(float *)(this + 0x278) * 0.5;
      local_10 = *(float *)(this + 0x27c) * 0.5;
      CBaseEntity::SetAbsVelocity((CBaseEntity *)this,(Vector *)&local_18);
    }
    return;
  }
  (**(code **)(*(int *)this + 0x56c))(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)