L L4D2node

CFuncRotating::UpdateSpeed

0x00632dd0 · 1035 bytes · __thiscall

_ZN13CFuncRotating11UpdateSpeedEf

Decompiled

undefined (2 params)

/* CFuncRotating::UpdateSpeed(float) */

void __thiscall CFuncRotating::UpdateSpeed(CFuncRotating *this,float param_1)

{
  float fVar1;
  char *pcVar2;
  int iVar3;
  float fVar4;
  float fVar5;
  undefined **local_80 [8];
  float local_60;
  undefined1 *local_5c;
  float local_58;
  int local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined1 local_3c;
  undefined1 local_3b;
  undefined1 local_3a;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined2 local_20;
  
  fVar5 = *(float *)(this + 0x45c);
  fVar1 = *(float *)(this + 0x11c);
  fVar4 = fVar5;
  if ((param_1 <= fVar5) && (fVar4 = -fVar5, -fVar5 <= param_1)) {
    fVar4 = param_1;
  }
  *(float *)(this + 0x11c) = fVar4;
  if (this[0x478] != (CFuncRotating)0x0) {
    iVar3 = 0;
    if (*(float *)(this + 0x440) == 0.0) {
      iVar3 = (uint)(*(float *)(this + 0x444) == 0.0) * 4 + 4;
    }
    fVar5 = (float)((int)((*(float *)(this + iVar3 + 0x3a8) - *(float *)(this + iVar3 + 0x46c)) *
                         182.04445) & 0xffff) * 0.005493164;
    if (180.0 < fVar5) {
      fVar5 = fVar5 - 360.0;
    }
    if (param_1 < 100.0) {
      fVar4 = ABS(fVar5);
      if ((25.0 < param_1) || (1.0 <= fVar4)) {
        if (90.0 < fVar4) {
          *(float *)(this + 0x11c) = fVar1;
          fVar4 = fVar1;
        }
        else {
          if (fVar4 <= 20.0) {
            fVar4 = 20.0;
          }
          if (fVar1 <= 0.0) {
            fVar4 = -fVar4;
          }
          *(float *)(this + 0x11c) = fVar4;
        }
      }
      else {
        *(undefined4 *)(this + 0x458) = 0;
        this[0x478] = (CFuncRotating)0x0;
        *(undefined4 *)(this + 0x11c) = 0;
        CBaseEntity::SetLocalAngles((CBaseEntity *)this,(QAngle *)(this + 0x46c));
        fVar4 = *(float *)(this + 0x11c);
      }
    }
  }
  if (fVar1 == 0.0) {
    if (fVar4 != 0.0) {
      fVar5 = *(float *)(this + 0x450);
      if (((byte)this[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
      }
      CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_80);
      local_80[0] = &PTR__CPASFilter_00bfaf28;
                    /* try { // try from 00632ffc to 00633000 has its CatchHandler @ 00633246 */
      CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_80,(Vector *)(this + 0x2e0));
      local_80[0] = &PTR__CPASAttenuationFilter_00c08ec8;
                    /* try { // try from 0063301d to 00633021 has its CatchHandler @ 00633207 */
      CPASAttenuationFilter::Filter
                ((CPASAttenuationFilter *)local_80,(Vector *)(this + 0x2e0),fVar5);
                    /* try { // try from 00633025 to 00633029 has its CatchHandler @ 00633244 */
      CRecipientFilter::MakeReliable((CRecipientFilter *)local_80);
      local_3c = 1;
      local_20 = 0xffff;
      local_50 = 0;
      local_48 = 0;
      local_44 = 0;
      local_5c = &DAT_00d539c2;
      if (*(undefined1 **)(this + 0x464) != (undefined1 *)0x0) {
        local_5c = *(undefined1 **)(this + 0x464);
      }
      local_40 = 0;
      local_3b = 0;
      local_54 = 0;
      local_3a = 0;
      local_38 = 0xffffffff;
      local_34 = 0;
      local_30 = 0;
      local_2c = 0;
      local_28 = 0;
      local_24 = 0;
      local_60 = 8.40779e-45;
      local_58 = 0.01;
      if (*(float *)(this + 0x450) != 0.0) {
        local_54 = (int)(20.0 / *(float *)(this + 0x450) + 50.0);
      }
      local_4c = 0x1e;
      if (*(int *)(this + 0x30) == 0) {
        iVar3 = 0;
      }
      else {
        iVar3 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
      }
                    /* try { // try from 006330ec to 006330f8 has its CatchHandler @ 00633220 */
      CBaseEntity::EmitSound((IRecipientFilter *)local_80,iVar3,(EmitSound_t *)&local_60);
      RampPitchVol(this);
      local_28 = 0;
      CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_34);
      local_24 = local_34;
      CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_34);
      local_80[0] = &PTR__CPASFilter_00bfaf28;
      CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_80);
      goto LAB_00632e49;
    }
  }
  else if (fVar4 == 0.0) {
    pcVar2 = "";
    if (*(char **)(this + 0x464) != (char *)0x0) {
      pcVar2 = *(char **)(this + 0x464);
    }
    if (*(int *)(this + 0x30) == 0) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
    }
    CBaseEntity::StopSound(iVar3,6,pcVar2);
    goto LAB_00632e49;
  }
  RampPitchVol(this);
LAB_00632e49:
  local_58 = *(float *)(this + 0x11c);
  local_60 = *(float *)(this + 0x440) * local_58;
  local_5c = (undefined1 *)(*(float *)(this + 0x444) * local_58);
  local_58 = local_58 * *(float *)(this + 0x448);
  CBaseEntity::SetLocalAngularVelocity((CBaseEntity *)this,(QAngle *)&local_60);
  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)