L L4D2node

CGibShooter::InitPointGib

0x0066fbe0 · 1576 bytes · __thiscall

_ZN11CGibShooter12InitPointGibEP4CGibRK6Vectorf

Decompiled

undefined (4 params)

/* CGibShooter::InitPointGib(CGib*, Vector const&, float) */

void __thiscall
CGibShooter::InitPointGib(CGibShooter *this,CGib *param_1,Vector *param_2,float param_3)

{
  float fVar1;
  CBaseEntity CVar2;
  CBaseEntity CVar3;
  CGibShooter CVar4;
  CBaseEntity CVar5;
  CBaseEntity CVar6;
  CBaseEntity CVar7;
  uint uVar8;
  CBaseEntity *this_00;
  CBaseEdict *pCVar9;
  char *pcVar10;
  int *piVar11;
  uint *puVar12;
  int iVar13;
  undefined4 *puVar14;
  undefined *puVar15;
  undefined *puVar16;
  longdouble lVar17;
  longdouble lVar18;
  float fVar19;
  char *local_38;
  undefined1 local_34 [12];
  float local_28;
  float local_24;
  float local_20;
  
  if (param_1 != (CGib *)0x0) {
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    CBaseEntity::SetLocalOrigin((CBaseEntity *)param_1,(Vector *)(this + 0x2e0));
    local_28 = param_3 * *(float *)param_2;
    local_24 = param_3 * *(float *)(param_2 + 4);
    local_20 = param_3 * *(float *)(param_2 + 8);
    CBaseEntity::SetAbsVelocity((CBaseEntity *)param_1,(Vector *)&local_28);
    lVar17 = (longdouble)(**(code **)(*random_valve + 4))(random_valve,0x42c80000,0x43960000);
    lVar18 = (longdouble)(**(code **)(*random_valve + 4))(random_valve,0x42c80000,0x43480000);
    local_28 = (float)lVar18;
    local_20 = 0.0;
    local_24 = (float)lVar17;
    CBaseEntity::SetLocalAngularVelocity((CBaseEntity *)param_1,(QAngle *)&local_28);
    lVar17 = (longdouble)CBaseEntity::GetNextThink((CBaseEntity *)param_1,(char *)0x0);
    fVar19 = *(float *)(this + 0x468);
    fVar1 = *(float *)(gpGlobals + 0xc);
    lVar18 = (longdouble)(**(code **)(*random_valve + 4))(random_valve,0x3f733333,0x3f866666);
    fVar19 = (float)lVar18 * fVar19;
    *(float *)(param_1 + 0x1400) = fVar19;
    if (((byte)this[0x148] & 4) != 0) {
      CBaseEntity::SetNextThink
                ((CBaseEntity *)param_1,fVar19 + *(float *)(gpGlobals + 0xc),(char *)0x0);
      CBaseEntity::ThinkSet((_func_void *)local_34,(float)param_1,(char *)CGib::DieThink);
      fVar19 = *(float *)(param_1 + 0x1400);
    }
    if (fVar19 < (float)lVar17 - fVar1) {
      CBaseEntity::SetNextThink
                ((CBaseEntity *)param_1,fVar19 + *(float *)(gpGlobals + 0xc),(char *)0x0);
      *(undefined4 *)(param_1 + 0x1400) = 0;
    }
    if (this[0x479] != (CGibShooter)0x0) {
      if (((byte)param_1[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
      }
      (**(code **)(*(int *)this + 0x20))(&local_38,this);
      pcVar10 = "";
      if (local_38 != (char *)0x0) {
        pcVar10 = local_38;
      }
      piVar11 = (int *)CSprite::SpriteCreate(pcVar10,(Vector *)(param_1 + 0x2e0),false);
      if (piVar11 == (int *)0x0) {
        *(undefined4 *)(param_1 + 0x1414) = 0xffffffff;
        return;
      }
      puVar12 = (uint *)(**(code **)(*piVar11 + 0xc))(piVar11);
      puVar15 = g_pEntityList;
      uVar8 = *puVar12;
      *(uint *)(param_1 + 0x1414) = uVar8;
      if ((((uVar8 != 0xffffffff) &&
           (puVar16 = puVar15 + (uVar8 & 0xfff) * 0x10, puVar16 != (undefined *)0xfffffffc)) &&
          (*(uint *)(puVar16 + 8) == uVar8 >> 0xc)) &&
         (this_00 = *(CBaseEntity **)(puVar16 + 4), this_00 != (CBaseEntity *)0x0)) {
        uVar8 = *(uint *)(this_00 + 0x440);
        if (((uVar8 == 0xffffffff) ||
            (puVar15 = puVar15 + (uVar8 & 0xfff) * 0x10, puVar15 == (undefined *)0xfffffffc)) ||
           ((*(uint *)(puVar15 + 8) != uVar8 >> 0xc || (param_1 != *(CGib **)(puVar15 + 4))))) {
          if (this_00[0x6c] == (CBaseEntity)0x0) {
            pCVar9 = *(CBaseEdict **)(this_00 + 0x30);
            if (pCVar9 != (CBaseEdict *)0x0) {
              *(uint *)pCVar9 = *(uint *)pCVar9 | 0x101;
              iVar13 = CBaseEdict::GetChangeAccessor(pCVar9);
              *(undefined2 *)(iVar13 + 2) = 0;
            }
          }
          else {
            this_00[0x70] = (CBaseEntity)((byte)this_00[0x70] | 1);
          }
          puVar14 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
          *(undefined4 *)(this_00 + 0x440) = *puVar14;
        }
        if (*(int *)(this_00 + 0x444) != 0) {
          if (this_00[0x6c] == (CBaseEntity)0x0) {
            pCVar9 = *(CBaseEdict **)(this_00 + 0x30);
            if (pCVar9 != (CBaseEdict *)0x0) {
              *(uint *)pCVar9 = *(uint *)pCVar9 | 0x101;
              iVar13 = CBaseEdict::GetChangeAccessor(pCVar9);
              *(undefined2 *)(iVar13 + 2) = 0;
            }
          }
          else {
            this_00[0x70] = (CBaseEntity)((byte)this_00[0x70] | 1);
          }
          *(undefined4 *)(this_00 + 0x444) = 0;
        }
        CBaseEntity::FollowEntity(this_00,(CBaseEntity *)param_1,true);
        (**(code **)(*(int *)this_00 + 0x50))(this_00,param_1);
        CSprite::SetScale((CSprite *)this_00,1.0,0.0);
        CVar2 = *(CBaseEntity *)(this + 0x120);
        CVar3 = *(CBaseEntity *)(this + 0x121);
        CVar4 = this[0x127];
        CVar5 = *(CBaseEntity *)(this + 0x124);
        CVar6 = *(CBaseEntity *)(this + 0x126);
        CVar7 = *(CBaseEntity *)(this + 0x125);
        if (CVar3 != this_00[0x121]) {
          if (this_00[0x6c] == (CBaseEntity)0x0) {
            pCVar9 = *(CBaseEdict **)(this_00 + 0x30);
            if (pCVar9 != (CBaseEdict *)0x0) {
              *(uint *)pCVar9 = *(uint *)pCVar9 | 0x101;
              iVar13 = CBaseEdict::GetChangeAccessor(pCVar9);
              *(undefined2 *)(iVar13 + 2) = 0;
            }
          }
          else {
            this_00[0x70] = (CBaseEntity)((byte)this_00[0x70] | 1);
          }
          this_00[0x121] = CVar3;
        }
        if (CVar5 != this_00[0x124]) {
          if (this_00[0x6c] == (CBaseEntity)0x0) {
            pCVar9 = *(CBaseEdict **)(this_00 + 0x30);
            if (pCVar9 != (CBaseEdict *)0x0) {
              *(uint *)pCVar9 = *(uint *)pCVar9 | 0x101;
              iVar13 = CBaseEdict::GetChangeAccessor(pCVar9);
              *(undefined2 *)(iVar13 + 2) = 0;
            }
          }
          else {
            this_00[0x70] = (CBaseEntity)((byte)this_00[0x70] | 1);
          }
          this_00[0x124] = CVar5;
        }
        if (CVar7 != this_00[0x125]) {
          if (this_00[0x6c] == (CBaseEntity)0x0) {
            pCVar9 = *(CBaseEdict **)(this_00 + 0x30);
            if (pCVar9 != (CBaseEdict *)0x0) {
              *(uint *)pCVar9 = *(uint *)pCVar9 | 0x101;
              iVar13 = CBaseEdict::GetChangeAccessor(pCVar9);
              *(undefined2 *)(iVar13 + 2) = 0;
            }
          }
          else {
            this_00[0x70] = (CBaseEntity)((byte)this_00[0x70] | 1);
          }
          this_00[0x125] = CVar7;
        }
        if (CVar6 != this_00[0x126]) {
          if (this_00[0x6c] == (CBaseEntity)0x0) {
            pCVar9 = *(CBaseEdict **)(this_00 + 0x30);
            if (pCVar9 != (CBaseEdict *)0x0) {
              *(uint *)pCVar9 = *(uint *)pCVar9 | 0x101;
              iVar13 = CBaseEdict::GetChangeAccessor(pCVar9);
              *(undefined2 *)(iVar13 + 2) = 0;
            }
          }
          else {
            this_00[0x70] = (CBaseEntity)((byte)this_00[0x70] | 1);
          }
          this_00[0x126] = CVar6;
        }
        CSprite::SetBrightness((CSprite *)this_00,(uint)(byte)CVar4,0.0);
        if (CVar2 != this_00[0x120]) {
          if (this_00[0x6c] == (CBaseEntity)0x0) {
            pCVar9 = *(CBaseEdict **)(this_00 + 0x30);
            if (pCVar9 != (CBaseEdict *)0x0) {
              *(uint *)pCVar9 = *(uint *)pCVar9 | 0x101;
              iVar13 = CBaseEdict::GetChangeAccessor(pCVar9);
              *(undefined2 *)(iVar13 + 2) = 0;
            }
          }
          else {
            this_00[0x70] = (CBaseEntity)((byte)this_00[0x70] | 1);
          }
          this_00[0x120] = CVar2;
        }
        fVar1 = *(float *)(this + 0x468);
        CBaseEntity::ThinkSet
                  ((_func_void *)local_34,(float)this_00,(char *)CSprite::AnimateUntilDead);
        if (*(float *)(this_00 + 0x448) != 5.0) {
          if (this_00[0x6c] == (CBaseEntity)0x0) {
            pCVar9 = *(CBaseEdict **)(this_00 + 0x30);
            if (pCVar9 != (CBaseEdict *)0x0) {
              *(uint *)pCVar9 = *(uint *)pCVar9 | 0x101;
              iVar13 = CBaseEdict::GetChangeAccessor(pCVar9);
              *(undefined2 *)(iVar13 + 2) = 0;
            }
          }
          else {
            this_00[0x70] = (CBaseEntity)((byte)this_00[0x70] | 1);
          }
          *(undefined4 *)(this_00 + 0x448) = 0x40a00000;
        }
        iVar13 = gpGlobals;
        *(float *)(this_00 + 0x450) = fVar1 + *(float *)(gpGlobals + 0xc) + 1.0;
        CBaseEntity::SetNextThink(this_00,*(float *)(iVar13 + 0xc),(char *)0x0);
        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)