L L4D2node

CGib::BounceGibTouch

0x006d3d70 · 802 bytes · __cdecl

_ZN4CGib14BounceGibTouchEP11CBaseEntity

Decompiled

undefined (1 param)

/* CGib::BounceGibTouch(CBaseEntity*) */

void CGib::BounceGibTouch(CBaseEntity *param_1)

{
  char cVar1;
  int iVar2;
  float fVar3;
  CTraceFilterSimple local_dc [16];
  undefined4 local_cc;
  undefined4 local_c8;
  float local_c4;
  undefined4 local_bc;
  undefined4 local_b8;
  undefined4 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;
  float local_70;
  float local_6c;
  float local_68;
  Vector local_64 [84];
  
  if (*(int *)(param_1 + 0x238) == 0) {
    if (((byte)param_1[0x150] & 1) != 0) {
      if (((byte)param_1[0x14d] & 0x10) != 0) {
        CBaseEntity::CalcAbsoluteVelocity(param_1);
      }
      local_70 = *(float *)(param_1 + 0x274) * 0.9;
      local_6c = *(float *)(param_1 + 0x278) * 0.9;
      local_68 = *(float *)(param_1 + 0x27c) * 0.9;
      CBaseEntity::SetAbsVelocity(param_1,(Vector *)&local_70);
      local_6c = *(float *)(param_1 + 0x3ac);
      local_70 = 0.0;
      local_68 = 0.0;
      CBaseEntity::SetLocalAngles(param_1,(QAngle *)&local_70);
      CBaseEntity::SetLocalAngularVelocity(param_1,(QAngle *)&vec3_angle);
      return;
    }
    cVar1 = UTIL_IsLowViolence();
    if (((cVar1 == '\0') && (0 < *(int *)(param_1 + 0x13f8))) && (*(int *)(param_1 + 0x1410) != -1))
    {
      if (((byte)param_1[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(param_1);
      }
      local_bc = 0;
      local_cc = *(undefined4 *)(param_1 + 0x2e0);
      local_b8 = 0;
      local_c4 = *(float *)(param_1 + 0x2e8) + 8.0;
      local_b4 = 0xc1c00000;
      local_c8 = *(undefined4 *)(param_1 + 0x2e4);
      local_87 = 1;
      local_94 = 0;
      local_98 = 0;
      local_9c = 0;
      local_8c = 0;
      local_88 = 1;
      local_a4 = 0;
      local_a8 = 0;
      local_ac = 0;
      CTraceFilterSimple::CTraceFilterSimple
                (local_dc,(IHandleEntity *)param_1,0,(_func_bool_IHandleEntity_ptr_int *)0x0);
      (**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,0x400b,local_dc,(Vector *)&local_70);
      if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
        DebugDrawLine((Vector *)&local_70,local_64,0xff,0,0,true,-1.0);
      }
      UTIL_BloodDecalTrace((CGameTrace *)&local_70,*(int *)(param_1 + 0x1410));
      *(int *)(param_1 + 0x13f8) = *(int *)(param_1 + 0x13f8) + -1;
    }
    if (*(int *)(param_1 + 0x13fc) != 10) {
      iVar2 = (**(code **)(*random_valve + 8))(random_valve,0,2);
      if (iVar2 == 0) {
        if (((byte)param_1[0x14d] & 0x10) != 0) {
          CBaseEntity::CalcAbsoluteVelocity(param_1);
        }
        if (ABS(*(float *)(param_1 + 0x27c)) * 0.0022222223 <= 1.0) {
          fVar3 = ABS(*(float *)(param_1 + 0x27c)) * 0.0022222223 * 0.8;
        }
        else {
          fVar3 = 0.8;
        }
        iVar2 = 0;
        if (*(int *)(param_1 + 0x30) != 0) {
          iVar2 = *(int *)(param_1 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        }
        CBreakable::MaterialSoundRandom(iVar2,*(undefined4 *)(param_1 + 0x13fc),fVar3);
      }
    }
  }
  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)