L L4D2node

CMovementSpeedMod::InputSpeedMod

0x007b3ce0 · 692 bytes · __thiscall

_ZN17CMovementSpeedMod13InputSpeedModER11inputdata_t

Decompiled

undefined (2 params)

/* CMovementSpeedMod::InputSpeedMod(inputdata_t&) */

void __thiscall CMovementSpeedMod::InputSpeedMod(CMovementSpeedMod *this,inputdata_t *param_1)

{
  CBaseEdict *this_00;
  code *pcVar1;
  char cVar2;
  int iVar3;
  CBasePlayer *this_01;
  undefined4 uVar4;
  int *piVar5;
  undefined *puVar6;
  uint uVar7;
  float fVar8;
  CBaseCombatWeapon *local_20;
  
  piVar5 = *(int **)param_1;
  if ((piVar5 == (int *)0x0) || (cVar2 = (**(code **)(*piVar5 + 0x16c))(piVar5), cVar2 == '\0')) {
    cVar2 = (**(code **)(*g_pGameRules + 0xd0))(g_pGameRules);
    if (cVar2 != '\0') {
      return;
    }
    this_01 = (CBasePlayer *)UTIL_GetLocalPlayer();
  }
  else {
    this_01 = *(CBasePlayer **)param_1;
  }
  if (this_01 == (CBasePlayer *)0x0) {
    return;
  }
  if ((*(int *)(param_1 + 0x18) == 1) && (*(float *)(param_1 + 8) == 1.0)) {
    if ((((byte)this[0x148] & 1) != 0) &&
       (iVar3 = CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this_01), iVar3 == 0))
    {
      uVar7 = *(uint *)(this_01 + 0x2064);
      local_20 = (CBaseCombatWeapon *)0x0;
      if (((uVar7 != 0xffffffff) &&
          (puVar6 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar6 + 8) == uVar7 >> 0xc)) {
        local_20 = *(CBaseCombatWeapon **)(puVar6 + 4);
      }
      CBaseCombatCharacter::SetActiveWeapon((CBaseCombatCharacter *)this_01,local_20);
      iVar3 = CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this_01);
      if (iVar3 != 0) {
        piVar5 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this_01);
        (**(code **)(*piVar5 + 0x424))(piVar5);
      }
    }
    (**(code **)(*(int *)this_01 + 0x5f0))(this_01,1);
    iVar3 = GetDisabledButtonMask(this);
    CBasePlayer::EnableButtons(this_01,iVar3);
    if ((((byte)this[0x148] & 2) == 0) ||
       (uVar7 = *(uint *)(this_01 + 0x1a7c) & 0xfffffffb, *(uint *)(this_01 + 0x1a7c) == uVar7))
    goto LAB_007b3da6;
  }
  else {
    if (((byte)this[0x148] & 1) != 0) {
      iVar3 = CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this_01);
      if (iVar3 != 0) {
        pcVar1 = *(code **)(*(int *)this_01 + 0x5cc);
        uVar4 = CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this_01);
        (*pcVar1)(this_01,uVar4);
        piVar5 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this_01);
        (**(code **)(*piVar5 + 0x428))(piVar5,0);
        CBaseCombatCharacter::SetActiveWeapon
                  ((CBaseCombatCharacter *)this_01,(CBaseCombatWeapon *)0x0);
      }
      CBasePlayer::HideViewModels(this_01);
    }
    iVar3 = (**(code **)(*(int *)this_01 + 0x5f4))(this_01);
    if (iVar3 != 0) {
      (**(code **)(*(int *)this_01 + 0x5fc))(this_01,0);
    }
    (**(code **)(*(int *)this_01 + 0x5f0))(this_01,0);
    iVar3 = GetDisabledButtonMask(this);
    CBasePlayer::DisableButtons(this_01,iVar3);
    if ((((byte)this[0x148] & 2) == 0) ||
       (uVar7 = *(uint *)(this_01 + 0x1a7c) | 4, *(uint *)(this_01 + 0x1a7c) == uVar7))
    goto LAB_007b3da6;
  }
  (**(code **)(*(int *)(this_01 + 0x1a40) + 4))(this_01 + 0x1a40,this_01 + 0x1a7c);
  *(uint *)(this_01 + 0x1a7c) = uVar7;
LAB_007b3da6:
  fVar8 = *(float *)(param_1 + 8);
  if (*(int *)(param_1 + 0x18) != 1) {
    fVar8 = 0.0;
  }
  if (fVar8 != *(float *)(this_01 + 0x20cc)) {
    if (this_01[0x6c] == (CBasePlayer)0x0) {
      this_00 = *(CBaseEdict **)(this_01 + 0x30);
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
      *(float *)(this_01 + 0x20cc) = fVar8;
    }
    else {
      this_01[0x70] = (CBasePlayer)((byte)this_01[0x70] | 1);
      *(float *)(this_01 + 0x20cc) = fVar8;
    }
  }
  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)