L L4D2node

CSpitterProjectile::DetonateThink

0x0055ba40 · 589 bytes · __thiscall

_ZN18CSpitterProjectile13DetonateThinkEv

Decompiled

undefined (1 param)

/* CSpitterProjectile::DetonateThink() */

void __thiscall CSpitterProjectile::DetonateThink(CSpitterProjectile *this)

{
  float fVar1;
  longdouble lVar2;
  float local_24;
  float local_18;
  float local_14;
  undefined4 local_10;
  
  if ((1.0 <= *(float *)(gpGlobals + 0xc) - *(float *)(this + 0x1a7c)) &&
     (*(float *)(this + 0x1a7c) != -1.0)) {
    CBaseEntity::SetMoveType((CBaseEntity *)this,5,1);
    if (((byte)this[0x14d] & 0x10) != 0) {
      CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this);
    }
    local_18 = *(float *)(this + 0x274) * 0.3;
    local_10 = *(undefined4 *)(this + 0x27c);
    local_14 = *(float *)(this + 0x278) * 0.3;
    CBaseEntity::SetAbsVelocity((CBaseEntity *)this,(Vector *)&local_18);
    *(undefined4 *)(this + 0x1a7c) = 0xbf800000;
  }
  if (((byte)this[0x14d] & 0x10) != 0) {
    CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this);
  }
  if (*(float *)(this + 0x274) * *(float *)(this + 0x274) +
      *(float *)(this + 0x27c) * *(float *)(this + 0x27c) +
      *(float *)(this + 0x278) * *(float *)(this + 0x278) <= 25.0) {
    if (*(float *)(this + 0x1a74) <= 0.0) {
      lVar2 = (longdouble)IntervalTimer::Now();
      fVar1 = (float)lVar2;
      if (fVar1 != *(float *)(this + 0x1a74)) {
        (**(code **)(*(int *)(this + 0x1a70) + 4))(this + 0x1a70,this + 0x1a74);
        *(float *)(this + 0x1a74) = fVar1;
      }
      local_24 = *(float *)(z_spit_detonate_delay._28_4_ + 0x2c);
      if (fVar1 <= 0.0) goto LAB_0055bace;
    }
    else {
      local_24 = *(float *)(z_spit_detonate_delay._28_4_ + 0x2c);
    }
    lVar2 = (longdouble)IntervalTimer::Now();
    if (local_24 < (float)lVar2 - *(float *)(this + 0x1a74)) {
      (**(code **)(*(int *)this + 0x56c))(this);
      return;
    }
  }
  else if (*(float *)(this + 0x1a74) != -1.0) {
    (**(code **)(*(int *)(this + 0x1a70) + 4))(this + 0x1a70,this + 0x1a74);
    *(undefined4 *)(this + 0x1a74) = 0xbf800000;
  }
LAB_0055bace:
  CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 0.1,(char *)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)