L L4D2node

phys_shoot

0x00803520 · 1428 bytes · __cdecl

_ZL10phys_shootRK8CCommand

Decompiled

undefined (1 param)

/* phys_shoot(CCommand const&) */

void phys_shoot(CCommand *param_1)

{
  CBaseEdict *pCVar1;
  int *piVar2;
  CBasePlayer *this;
  CBaseEntity *this_00;
  int iVar3;
  code *pcVar4;
  char *pcVar5;
  uint uVar6;
  int iVar7;
  longdouble lVar8;
  float fVar9;
  float fVar10;
  float fVar11;
  char *local_118;
  float local_110;
  float local_100;
  float local_fc;
  float local_f8;
  float local_f4;
  float local_f0;
  float local_ec;
  float local_e8;
  float local_e4;
  float local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  float local_d4;
  float local_cc;
  float local_c8;
  float local_c4;
  float local_bc;
  float local_b8;
  float local_b4;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_8c;
  undefined1 local_88;
  undefined1 local_87;
  Vector local_70 [12];
  undefined4 local_64;
  undefined4 local_60;
  float local_5c;
  float local_44;
  
  this = (CBasePlayer *)UTIL_GetCommandClient();
  if (this != (CBasePlayer *)0x0) {
    CBasePlayer::EyeVectors(this,(Vector *)&local_100,(Vector *)0x0,(Vector *)0x0);
    fVar11 = local_100 * 100.0;
    fVar10 = local_fc * 100.0;
    fVar9 = local_f8 * 100.0;
    (**(code **)(*(int *)this + 0x234))(&local_e8,this);
    (**(code **)(*(int *)this + 0x234))(&local_f4,this);
    local_94 = 0;
    local_cc = local_f4;
    local_bc = (fVar11 - local_f4) + local_e8;
    local_c8 = local_f0;
    local_c4 = local_ec;
    local_b4 = (fVar9 - local_ec) + local_e0;
    local_98 = 0;
    local_b8 = (fVar10 - local_f0) + local_e4;
    local_9c = 0;
    local_8c = 0;
    local_88 = 1;
    local_a4 = 0;
    local_a8 = 0;
    local_ac = 0;
    local_87 = local_b4 * local_b4 + local_bc * local_bc + local_b8 * local_b8 != 0.0;
    CTraceFilterSimple::CTraceFilterSimple
              ((CTraceFilterSimple *)&local_dc,(IHandleEntity *)this,0,
               (_func_bool_IHandleEntity_ptr_int *)0x0);
    (**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,0x202420b,&local_dc,local_70);
    if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
      DebugDrawLine(local_70,(Vector *)&local_64,0xff,0,0,true,-1.0);
    }
    iVar7 = 1;
    local_118 = "models/props_plants/claypot03.mdl";
    local_110 = *(float *)(g_cv_phys2_shoot_speed._28_4_ + 0x2c);
    if (1 < *(int *)param_1) {
      do {
        while( true ) {
          pcVar5 = *(char **)(param_1 + iVar7 * 4 + 0x408);
          iVar3 = _V_strcmp(pcVar5,"0");
          if (iVar3 != 0) break;
          local_110 = 0.0;
          fVar9 = local_110;
LAB_008037d0:
          local_110 = fVar9;
          iVar7 = iVar7 + 1;
          if (*(int *)param_1 <= iVar7) goto LAB_00803848;
        }
        lVar8 = (longdouble)V_atof(pcVar5);
        fVar9 = (float)lVar8;
        if ((float)lVar8 != 0.0) goto LAB_008037d0;
        local_118 = "";
        if (iVar7 < *(int *)param_1) {
          local_118 = *(char **)(param_1 + iVar7 * 4 + 0x408);
        }
        iVar7 = iVar7 + 1;
        DevMsg("Using model \"%s\"\n",local_118);
      } while (iVar7 < *(int *)param_1);
    }
LAB_00803848:
    local_e8 = local_100 * local_110;
    local_dc = local_64;
    local_e4 = local_fc * local_110;
    local_d8 = local_60;
    local_d4 = local_5c;
    local_e0 = local_f8 * local_110;
    if (local_44 != 1.0) {
      local_d4 = local_5c + 24.0;
    }
    local_cc = 0.0;
    local_c8 = 0.0;
    local_c4 = 0.0;
    this_00 = (CBaseEntity *)
              CBaseEntity::CreateNoSpawn
                        ("prop_physics",(Vector *)&local_dc,(QAngle *)&local_cc,(CBaseEntity *)0x0);
    if ((local_118 == (char *)0x0) || (*local_118 == '\0')) {
      *(undefined4 *)(this_00 + 0x260) = 0;
      CBaseEntity::DispatchUpdateTransmitState(this_00);
      pcVar4 = *(code **)(*soundemitterbase + 0x88);
      pcVar5 = "";
    }
    else {
      *(char **)(this_00 + 0x260) = local_118;
      CBaseEntity::DispatchUpdateTransmitState(this_00);
      pcVar4 = *(code **)(*soundemitterbase + 0x88);
      pcVar5 = local_118;
    }
    iVar7 = (*pcVar4)(soundemitterbase,pcVar5);
    if (iVar7 != *(int *)(this_00 + 0xf4)) {
      if (this_00[0x6c] == (CBaseEntity)0x0) {
        pCVar1 = *(CBaseEdict **)(this_00 + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar3 + 2) = 0;
        }
      }
      else {
        this_00[0x70] = (CBaseEntity)((byte)this_00[0x70] | 1);
      }
      *(int *)(this_00 + 0xf4) = iVar7;
    }
    (**(code **)(*(int *)this_00 + 0x6c))(this_00);
    (**(code **)(*(int *)this_00 + 0x70))(this_00,local_118);
    uVar6 = *(uint *)(this_00 + 0x148) | 0x2000;
    if (*(uint *)(this_00 + 0x148) != uVar6) {
      if (this_00[0x6c] == (CBaseEntity)0x0) {
        pCVar1 = *(CBaseEdict **)(this_00 + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar7 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar7 + 2) = 0;
        }
      }
      else {
        this_00[0x70] = (CBaseEntity)((byte)this_00[0x70] | 1);
      }
      *(uint *)(this_00 + 0x148) = uVar6;
    }
    (**(code **)(*(int *)this_00 + 100))(this_00);
    piVar2 = *(int **)(this_00 + 0x238);
    if (piVar2 != (int *)0x0) {
      (**(code **)(*piVar2 + 0xd8))(piVar2,&local_e8,0);
      local_c4 = *(float *)(phys_shoot_torque._28_4_ + 0x2c);
      local_cc = 0.0;
      local_c8 = 0.0;
      (**(code **)(*piVar2 + 0xfc))(piVar2,&local_cc);
    }
  }
  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)