L L4D2node

CGib::StickyGibTouch

0x006d4400 · 976 bytes · __thiscall

_ZN4CGib14StickyGibTouchEP11CBaseEntity

Decompiled

undefined (2 params)

/* CGib::StickyGibTouch(CBaseEntity*) */

void __thiscall CGib::StickyGibTouch(CGib *this,CBaseEntity *param_1)

{
  float fVar1;
  float fVar2;
  float fVar3;
  char cVar4;
  uint uVar5;
  undefined1 local_e4 [8];
  uint local_dc;
  uint local_d8;
  uint local_d4;
  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 [12];
  uint local_58;
  uint local_54;
  uint local_50;
  
  CBaseEntity::ThinkSet((_func_void *)local_e4,(float)this,(char *)CBaseEntity::SUB_Remove);
  CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 10.0,(char *)0x0);
  if (*(char **)(param_1 + 0x7c) != "worldspawn") {
    cVar4 = CBaseEntity::ClassMatchesComplex(param_1,"worldspawn");
    if (cVar4 == '\0') {
      CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc),(char *)0x0);
      return;
    }
  }
  uVar5 = *(uint *)(this + 0x14c);
  if ((uVar5 & 0x1000) != 0) {
    CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this);
    uVar5 = *(uint *)(this + 0x14c);
  }
  fVar1 = *(float *)(this + 0x274);
  fVar2 = *(float *)(this + 0x278);
  fVar3 = *(float *)(this + 0x27c);
  if ((uVar5 & 0x800) == 0) {
    local_cc = *(float *)(this + 0x2e0);
    local_c8 = *(float *)(this + 0x2e4);
    local_c4 = *(float *)(this + 0x2e8);
    local_bc = fVar1 * 32.0 + local_cc;
    local_b8 = fVar2 * 32.0 + local_c8;
    local_b4 = fVar3 * 32.0 + local_c4;
  }
  else {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    local_cc = *(float *)(this + 0x2e0);
    local_c8 = *(float *)(this + 0x2e4);
    local_bc = fVar1 * 32.0 + local_cc;
    local_c4 = *(float *)(this + 0x2e8);
    local_b8 = fVar2 * 32.0 + local_c8;
    local_b4 = fVar3 * 32.0 + local_c4;
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
      local_cc = *(float *)(this + 0x2e0);
      local_c8 = *(float *)(this + 0x2e4);
      local_c4 = *(float *)(this + 0x2e8);
    }
  }
  local_bc = local_bc - local_cc;
  local_b4 = local_b4 - local_c4;
  local_b8 = local_b8 - local_c8;
  local_8c = 0;
  local_88 = 1;
  local_94 = 0;
  local_98 = 0;
  local_87 = local_bc * local_bc + local_b4 * local_b4 + local_b8 * local_b8 != 0.0;
  local_9c = 0;
  local_a4 = 0;
  local_a8 = 0;
  local_ac = 0;
  CTraceFilterSimple::CTraceFilterSimple
            ((CTraceFilterSimple *)&local_dc,(IHandleEntity *)this,0,
             (_func_bool_IHandleEntity_ptr_int *)0x0);
  (**(code **)(*enginetrace + 0x14))
            (enginetrace,(QAngle *)&local_cc,0x400b,(CTraceFilterSimple *)&local_dc,local_70);
  if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
    DebugDrawLine(local_70,local_64,0xff,0,0,true,-1.0);
  }
  UTIL_BloodDecalTrace((CGameTrace *)local_70,*(int *)(this + 0x1410));
  local_dc = local_58 ^ 0x80000000;
  local_d8 = local_54 ^ 0x80000000;
  local_d4 = local_50 ^ 0x80000000;
  VectorAngles((Vector *)&local_dc,(QAngle *)&local_cc);
  CBaseEntity::SetLocalAngles((CBaseEntity *)this,(QAngle *)&local_cc);
  CBaseEntity::SetAbsVelocity((CBaseEntity *)this,(Vector *)&vec3_origin);
  CBaseEntity::SetLocalAngularVelocity((CBaseEntity *)this,(QAngle *)&vec3_angle);
  CBaseEntity::SetMoveType((CBaseEntity *)this,0,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)