L L4D2node

CTankRock::Spawn

0x004e1290 · 621 bytes · __thiscall

_ZN9CTankRock5SpawnEv

Decompiled

undefined (1 param)

/* CTankRock::Spawn() */

void __thiscall CTankRock::Spawn(CTankRock *this)

{
  char cVar1;
  int *piVar2;
  undefined4 uVar3;
  CBaseEntity *this_00;
  int iVar4;
  uint uVar5;
  char *pcVar6;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  piVar2 = (int *)CBaseGrenade::GetThrower((CBaseGrenade *)this);
  if (piVar2 == (int *)0x0) {
LAB_004e12bd:
    uVar3 = PickTankProjectileForGround(0x43);
    (**(code **)(*(int *)this + 0x70))(this,uVar3);
    UTIL_LogPrintf("Tank rock %s\n",uVar3);
    *(undefined4 *)(this + 0x1a70) = 0x43;
    CBaseCSGrenadeProjectile::Spawn((CBaseCSGrenadeProjectile *)this);
    (**(code **)(*(int *)this + 0x70))(this,uVar3);
LAB_004e1305:
    this_00 = (CBaseEntity *)CreateEntityByName("info_particle_system",-1,true);
    if (this_00 == (CBaseEntity *)0x0) goto LAB_004e13b3;
    (**(code **)(*(int *)this_00 + 0x84))(this_00,"start_active",&DAT_00cbe2d5);
    iVar4 = *(int *)this_00;
    pcVar6 = "tank_rock_throw_rock";
  }
  else {
    cVar1 = (**(code **)(*piVar2 + 0x16c))(piVar2);
    if (cVar1 == '\0') goto LAB_004e12bd;
    iVar4 = (**(code **)(*piVar2 + 0x438))(piVar2);
    if (iVar4 == 0) goto LAB_004e12bd;
    iVar4 = (**(code **)(*piVar2 + 0x438))(piVar2);
    if (iVar4 == 0) goto LAB_004e12bd;
    uVar5 = (uint)*(ushort *)(iVar4 + 0x4c);
    uVar3 = PickTankProjectileForGround(uVar5);
    (**(code **)(*(int *)this + 0x70))(this,uVar3);
    UTIL_LogPrintf("Tank rock %s\n",uVar3);
    *(uint *)(this + 0x1a70) = uVar5;
    CBaseCSGrenadeProjectile::Spawn((CBaseCSGrenadeProjectile *)this);
    (**(code **)(*(int *)this + 0x70))(this,uVar3);
    if (uVar5 != 0x4f) goto LAB_004e1305;
    this_00 = (CBaseEntity *)CreateEntityByName("info_particle_system",-1,true);
    if (this_00 == (CBaseEntity *)0x0) goto LAB_004e13b3;
    (**(code **)(*(int *)this_00 + 0x84))(this_00,"start_active",&DAT_00cbe2d5);
    iVar4 = *(int *)this_00;
    pcVar6 = "tank_rock_throw_stump";
  }
  (**(code **)(iVar4 + 0x84))(this_00,"effect_name",pcVar6);
  (**(code **)(*(int *)this_00 + 0x98))(this_00,this,0xffffffff);
  CBaseEntity::SetLocalOrigin(this_00,(Vector *)&vec3_origin);
  CBaseEntity::SetLocalAngles(this_00,(QAngle *)&vec3_angle);
  DispatchSpawn(this_00,true);
  (**(code **)(*(int *)this_00 + 0x94))(this_00);
LAB_004e13b3:
  local_28 = 0x40800000;
  local_24 = 0x40800000;
  local_20 = 0x40800000;
  local_34 = 0xc0800000;
  local_30 = 0xc0800000;
  local_2c = 0xc0800000;
  CBaseEntity::SetSize((CBaseEntity *)this,(Vector *)&local_34,(Vector *)&local_28);
  if (*(float *)(this + 0x1a88) != -1.0) {
    (**(code **)(*(int *)(this + 0x1a84) + 4))(this + 0x1a84,this + 0x1a88);
    *(undefined4 *)(this + 0x1a88) = 0xbf800000;
  }
  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)