L L4D2node

CBaseGrenade::TumbleThink

0x00413490 · 631 bytes · __thiscall

_ZN12CBaseGrenade11TumbleThinkEv

Decompiled

undefined (1 param)

/* CBaseGrenade::TumbleThink() */

void __thiscall CBaseGrenade::TumbleThink(CBaseGrenade *this)

{
  float fVar1;
  float fVar2;
  CBaseGrenade CVar3;
  CBaseEdict *this_00;
  char cVar4;
  uint uVar5;
  int iVar6;
  float fVar7;
  float fVar8;
  undefined1 local_24 [12];
  float local_18;
  float local_14;
  float local_10;
  
  cVar4 = CBaseEntity::IsInWorld((CBaseEntity *)this);
  if (cVar4 == '\0') {
    CBaseEntity::Remove((CBaseEntity *)this);
    return;
  }
  (**(code **)(*(int *)this + 0x32c))(this);
  CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 0.1,(char *)0x0);
  fVar7 = *(float *)(this + 0x1a48);
  fVar8 = *(float *)(gpGlobals + 0xc);
  if (fVar7 - 1.0 < fVar8) {
    uVar5 = *(uint *)(this + 0x14c);
    fVar7 = fVar7 - fVar8;
    if ((uVar5 & 0x1000) != 0) {
      CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this);
      uVar5 = *(uint *)(this + 0x14c);
    }
    fVar8 = *(float *)(this + 0x274);
    fVar1 = *(float *)(this + 0x278);
    fVar2 = *(float *)(this + 0x27c);
    if ((uVar5 & 0x800) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    local_14 = fVar1 * fVar7 + *(float *)(this + 0x2e4);
    local_10 = fVar7 * fVar2 + *(float *)(this + 0x2e8);
    local_18 = fVar8 * fVar7 + *(float *)(this + 0x2e0);
    CSoundEnt::InsertSound(8,(Vector *)&local_18,400,0.1,(CBaseEntity *)this,0,(CBaseEntity *)0x0);
    fVar7 = *(float *)(this + 0x1a48);
    fVar8 = *(float *)(gpGlobals + 0xc);
  }
  if (fVar7 <= fVar8) {
    CBaseEntity::ThinkSet((_func_void *)local_24,(float)this,(char *)0x56d);
    CVar3 = this[0x253];
  }
  else {
    CVar3 = this[0x253];
  }
  if (CVar3 != (CBaseGrenade)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);
    if (*(float *)(this + 0x468) != 0.2) {
      if (this[0x6c] == (CBaseGrenade)0x0) {
        this_00 = *(CBaseEdict **)(this + 0x30);
        if (this_00 != (CBaseEdict *)0x0) {
          *(uint *)this_00 = *(uint *)this_00 | 0x101;
          iVar6 = CBaseEdict::GetChangeAccessor(this_00);
          *(undefined2 *)(iVar6 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CBaseGrenade)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + 0x468) = 0x3e4ccccd;
      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)