L L4D2node

CVomitParticle::FlyThink

0x004e59b0 · 1377 bytes · __thiscall

_ZN14CVomitParticle8FlyThinkEv

Decompiled

undefined (1 param)

/* CVomitParticle::FlyThink() */

void __thiscall CVomitParticle::FlyThink(CVomitParticle *this)

{
  float fVar1;
  float fVar2;
  float fVar3;
  uint uVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  undefined *puVar7;
  IHandleEntity *pIVar8;
  int iVar9;
  float fVar10;
  float fVar11;
  float local_f8;
  float local_f4;
  float local_f0;
  undefined4 local_ec;
  undefined4 local_e8;
  undefined4 local_e4;
  CTraceFilterSkipTwoEntities local_e0 [20];
  float local_cc;
  float local_c8;
  float local_c4;
  float local_bc;
  float local_b8;
  float local_b4;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_8c;
  undefined1 local_88;
  undefined1 local_87;
  Vector local_70 [12];
  Vector local_64 [32];
  float local_44;
  CBaseEntity *local_24;
  
  if (*(float *)(this + 0x458) <= *(float *)(gpGlobals + 0xc)) {
    UTIL_Remove((CBaseEntity *)this);
    return;
  }
  if (((byte)this[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
  }
  local_f8 = *(float *)(this + 0x2e0);
  local_f4 = *(float *)(this + 0x2e4);
  local_f0 = *(float *)(this + 0x2e8);
  local_ec = *(undefined4 *)(this + 0x474);
  local_e8 = *(undefined4 *)(this + 0x478);
  local_e4 = *(undefined4 *)(this + 0x47c);
  uVar6 = (**(code **)(*(int *)this + 0x2c8))(this);
  uVar4 = *(uint *)(this + 0x470);
  pIVar8 = (IHandleEntity *)0x0;
  if (((uVar4 != 0xffffffff) &&
      (puVar7 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar7 + 8) == uVar4 >> 0xc)) {
    pIVar8 = *(IHandleEntity **)(puVar7 + 4);
  }
  CTraceFilterSkipTwoEntities::CTraceFilterSkipTwoEntities(local_e0,(IHandleEntity *)this,pIVar8,0);
  local_c8 = *(float *)(this + 0x478);
  local_8c = 0;
  local_c4 = *(float *)(this + 0x47c);
  local_88 = 1;
  local_b8 = local_f4 - local_c8;
  local_cc = *(float *)(this + 0x474);
  local_b4 = local_f0 - local_c4;
  local_bc = local_f8 - local_cc;
  local_94 = 0;
  local_98 = 0;
  local_9c = 0;
  local_87 = local_b8 * local_b8 + local_b4 * local_b4 + local_bc * local_bc != 0.0;
  local_a4 = 0;
  local_a8 = 0;
  local_ac = 0;
  (**(code **)(*enginetrace + 0x14))(enginetrace,(Vector *)&local_cc,uVar6,local_e0,local_70);
  if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
    DebugDrawLine(local_70,local_64,0xff,0,0,true,-1.0);
  }
  uVar6 = z_vomit_lifetime._28_4_;
  if ((local_44 < 1.0) && (local_24 != (CBaseEntity *)0x0)) {
    if (*(int *)(z_vomit_debug._28_4_ + 0x30) != 0) {
      NDebugOverlay::Line((Vector *)&local_ec,(Vector *)&local_f8,0xff,100,0,true,10.0);
      NDebugOverlay::EntityBounds((CBaseEntity *)this,0xff,100,0,0,10.0);
    }
    OnCollide(this,local_24);
    return;
  }
  *(float *)(this + 0x474) = local_f8;
  *(float *)(this + 0x478) = local_f4;
  *(float *)(this + 0x47c) = local_f0;
  uVar5 = z_vomit_float._28_4_;
  fVar10 = (*(float *)(uVar6 + 0x2c) + *(float *)(gpGlobals + 0xc)) - *(float *)(this + 0x458);
  fVar11 = *(float *)(z_vomit_velocityfadeend._28_4_ + 0x2c);
  fVar1 = *(float *)(z_vomit_velocityfadestart._28_4_ + 0x2c);
  if (fVar11 == fVar1) {
    fVar11 = (float)(~-(uint)(fVar11 <= fVar10) & 0x3f800000);
  }
  else {
    fVar11 = (fVar10 - fVar1) / (fVar11 - fVar1);
    if (1.0 <= fVar11) {
      fVar11 = 1.0;
    }
    if (fVar11 <= 0.0) {
      fVar11 = 0.0;
    }
    fVar11 = 1.0 - fVar11;
  }
  fVar1 = *(float *)(this + 0x440);
  fVar10 = *(float *)(this + 0x444);
  fVar2 = *(float *)(z_vomit_drag._28_4_ + 0x2c);
  fVar3 = *(float *)(this + 0x448);
  *(float *)(this + 0x440) = fVar1 * fVar2;
  *(float *)(this + 0x444) = fVar10 * fVar2;
  local_c8 = *(float *)(this + 0x450) * fVar11 + fVar10 * fVar2;
  *(float *)(this + 0x448) = fVar2 * fVar3;
  local_cc = fVar11 * *(float *)(this + 0x44c) + fVar1 * fVar2;
  local_c4 = fVar2 * fVar3 + *(float *)(uVar5 + 0x2c) + *(float *)(this + 0x454) * fVar11;
  CBaseEntity::SetAbsVelocity((CBaseEntity *)this,(Vector *)&local_cc);
  if (*(int *)(z_vomit_debug._28_4_ + 0x30) != 0) {
    if (*(int *)(this + 0x468) < 1) {
      NDebugOverlay::EntityBounds((CBaseEntity *)this,0,100,0xff,0,10.0);
    }
    else {
      iVar9 = (int)(*(float *)(gpGlobals + 0xc) * 10.0) % 0xff;
      NDebugOverlay::EntityBounds((CBaseEntity *)this,iVar9,0xff,iVar9,0,10.0);
    }
    NDebugOverlay::Line((Vector *)&local_ec,(Vector *)&local_f8,0,100,0xff,true,10.0);
  }
  CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc),(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)