L L4D2node

CPipeBombProjectile::Create

0x00554430 · 660 bytes · __cdecl

_ZN19CPipeBombProjectile6CreateERK6VectorRK6QAngleS2_S2_P20CBaseCombatCharacterf

Decompiled

undefined (6 params)

/* CPipeBombProjectile::Create(Vector const&, QAngle const&, Vector const&, Vector const&,
   CBaseCombatCharacter*, float) */

CBaseCSGrenadeProjectile *
CPipeBombProjectile::Create
          (Vector *param_1,QAngle *param_2,Vector *param_3,Vector *param_4,
          CBaseCombatCharacter *param_5,float param_6)

{
  code *pcVar1;
  CBaseEdict *pCVar2;
  CBaseCSGrenadeProjectile *this;
  undefined4 uVar3;
  int iVar4;
  undefined1 local_24 [20];
  
  this = (CBaseCSGrenadeProjectile *)
         CBaseEntity::Create("pipe_bomb_projectile",param_1,param_2,(CBaseEntity *)param_5);
  UTIL_LogPrintf("Pipe bomb projectile spawned at %f %f %f, velocity %f %f %f\n",
                 (double)*(float *)param_1,(double)*(float *)(param_1 + 4),
                 (double)*(float *)(param_1 + 8),(double)*(float *)param_3,
                 (double)*(float *)(param_3 + 4),(double)*(float *)(param_3 + 8));
  CBaseCSGrenadeProjectile::SetDetonateTimerLength
            (this,*(float *)(PipeBombTimerDuration._28_4_ + 0x2c));
  CBaseEntity::SetAbsVelocity((CBaseEntity *)this,param_3);
  CBaseCSGrenadeProjectile::SetupInitialTransmittedGrenadeVelocity(this,param_3);
  CBaseGrenade::SetThrower((CBaseGrenade *)this,param_5);
  *(undefined4 *)(this + 0x2c0) = 0x3ecccccd;
  CBaseEntity::SetFriction((CBaseEntity *)this,0.2);
  if (*(float *)(this + 0x2c8) != 0.45) {
    if (this[0x6c] == (CBaseCSGrenadeProjectile)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar4 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBaseCSGrenadeProjectile)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x2c8) = 0x3ee66666;
  }
  if (*(float *)(this + 0x1a50) != 25.0) {
    if (this[0x6c] == (CBaseCSGrenadeProjectile)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar4 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBaseCSGrenadeProjectile)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x1a50) = 0x41c80000;
  }
  if (*(float *)(this + 0x1a44) != 400.0) {
    if (this[0x6c] == (CBaseCSGrenadeProjectile)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar4 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBaseCSGrenadeProjectile)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x1a44) = 0x43c80000;
  }
  if (param_5 != (CBaseCombatCharacter *)0x0) {
    pcVar1 = *(code **)(*(int *)this + 0x194);
    uVar3 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_5);
    (*pcVar1)(this,uVar3);
  }
  CBaseEntity::ApplyLocalAngularVelocityImpulse((CBaseEntity *)this,param_4);
  CBaseEntity::ThinkSet
            ((_func_void *)local_24,(float)this,(char *)CBaseCSGrenadeProjectile::DangerSoundThink);
  CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc),(char *)0x0);
  CBaseEntity::ThinkSet((_func_void *)local_24,(float)this,(char *)BeepThink);
  return this;
}

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)