L L4D2node

CGibShooter::CreateGib

0x0066d270 · 278 bytes · __thiscall

_ZN11CGibShooter9CreateGibEv

Decompiled

undefined (1 param)

/* CGibShooter::CreateGib() */

CGib * __thiscall CGibShooter::CreateGib(CGibShooter *this)

{
  CBaseEdict *this_00;
  char cVar1;
  CGib *this_01;
  int iVar2;
  int iVar3;
  ConVarRef *this_02;
  char *pcVar4;
  ConVarRef local_24 [4];
  int local_20;
  
  this_02 = local_24;
  pcVar4 = "violence_hgibs";
  ConVarRef::ConVarRef(this_02,"violence_hgibs");
  cVar1 = ConVarRef::IsValid(this_02);
  if ((cVar1 == '\0') || (this_01 = (CGib *)0x0, *(int *)(local_20 + 0x30) != 0)) {
    this_01 = _CreateEntity<CGib>((CGib *)this_02,pcVar4);
    CGib::Spawn(this_01,"models/gibs/hgibs.mdl");
    CGib::SetBloodColor(this_01,0);
    iVar2 = *(int *)(this + 0x470);
    if (iVar2 < 2) {
      DevWarning(2,"GibShooter Body is <= 1!\n");
      iVar2 = *(int *)(this + 0x470);
    }
    iVar2 = (**(code **)(*random_valve + 8))(random_valve,1,iVar2 + -1);
    if (iVar2 != *(int *)(this_01 + 0x45c)) {
      if (this_01[0x6c] == (CGib)0x0) {
        this_00 = *(CBaseEdict **)(this_01 + 0x30);
        if (this_00 != (CBaseEdict *)0x0) {
          *(uint *)this_00 = *(uint *)this_00 | 0x101;
          iVar3 = CBaseEdict::GetChangeAccessor(this_00);
          *(undefined2 *)(iVar3 + 2) = 0;
        }
        *(int *)(this_01 + 0x45c) = iVar2;
      }
      else {
        this_01[0x70] = (CGib)((byte)this_01[0x70] | 1);
        *(int *)(this_01 + 0x45c) = iVar2;
      }
    }
    if (*(int *)(this + 0x47c) != 0) {
      CBaseAnimating::SetLightingOrigin((CBaseAnimating *)this_01,*(undefined4 *)(this + 0x47c));
    }
  }
  return this_01;
}

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)