L L4D2node

CSpitterProjectile::Create

0x0055bf50 · 662 bytes · __cdecl

_ZN18CSpitterProjectile6CreateERK6VectorRK6QAngleS2_S2_P20CBaseCombatCharacter

Decompiled

undefined (5 params)

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

CBaseEntity *
CSpitterProjectile::Create
          (Vector *param_1,QAngle *param_2,Vector *param_3,Vector *param_4,
          CBaseCombatCharacter *param_5)

{
  code *pcVar1;
  CBaseEdict *pCVar2;
  CBaseEntity *this;
  undefined4 uVar3;
  int iVar4;
  undefined1 local_24 [20];
  
  this = (CBaseEntity *)
         CBaseEntity::Create("spitter_projectile",param_1,param_2,(CBaseEntity *)param_5);
  UTIL_LogPrintf("Spitter 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((CBaseCSGrenadeProjectile *)this,1.5);
  CBaseEntity::SetAbsVelocity(this,param_3);
  CBaseCSGrenadeProjectile::SetupInitialTransmittedGrenadeVelocity
            ((CBaseCSGrenadeProjectile *)this,param_3);
  CBaseGrenade::SetThrower((CBaseGrenade *)this,param_5);
  CBaseEntity::SetMoveType(this,4);
  CBaseEntity::SetFriction(this,0.2);
  if (*(float *)(this + 0x2c8) != 0.75) {
    if (this[0x6c] == (CBaseEntity)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] = (CBaseEntity)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x2c8) = 0x3f400000;
  }
  *(undefined4 *)(this + 0xd8) = 0x569;
  *(undefined4 *)(this + 0xdc) = 0;
  CBaseEntity::ThinkSet((_func_void *)local_24,(float)this,(char *)DetonateThink);
  CBaseEntity::SetNextThink(this,*(float *)(gpGlobals + 0xc) + 0.1,(char *)0x0);
  if (*(float *)(this + 0x1a50) != 200.0) {
    if (this[0x6c] == (CBaseEntity)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] = (CBaseEntity)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x1a50) = 0x43480000;
  }
  if (*(float *)(this + 0x1a44) != 300.0) {
    if (this[0x6c] == (CBaseEntity)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] = (CBaseEntity)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x1a44) = 0x43960000;
  }
  pcVar1 = *(code **)(*(int *)this + 0x194);
  uVar3 = 3;
  if (param_5 != (CBaseCombatCharacter *)0x0) {
    uVar3 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_5);
  }
  (*pcVar1)(this,uVar3);
  CBaseEntity::ApplyLocalAngularVelocityImpulse(this,param_4);
  *(undefined4 *)(this + 0x1a7c) = *(undefined4 *)(gpGlobals + 0xc);
  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)