L L4D2node

CGameMovement::CheckParameters

0x00456af0 · 758 bytes · __thiscall

_ZN13CGameMovement15CheckParametersEv

Decompiled

undefined (1 param)

/* CGameMovement::CheckParameters() */

void __thiscall CGameMovement::CheckParameters(CGameMovement *this)

{
  int iVar1;
  int *piVar2;
  code *pcVar3;
  int iVar4;
  bool bVar5;
  longdouble lVar6;
  float fVar7;
  float fVar8;
  float local_20;
  float local_18;
  float local_14;
  float local_10;
  
  iVar4 = *(int *)(this + 4);
  if ((*(byte *)(iVar4 + 0x186) == 1) || ((*(byte *)(iVar4 + 0x186) & 0xfd) == 8))
  goto LAB_00456c34;
  iVar1 = *(int *)(this + 8);
  fVar7 = *(float *)(iVar1 + 0x30) * *(float *)(iVar1 + 0x30) +
          *(float *)(iVar1 + 0x2c) * *(float *)(iVar1 + 0x2c) +
          *(float *)(iVar1 + 0x34) * *(float *)(iVar1 + 0x34);
  fVar8 = *(float *)(iVar1 + 0x3c);
  if (fVar8 != 0.0) {
    if (*(float *)(iVar1 + 0x38) <= fVar8) {
      fVar8 = *(float *)(iVar1 + 0x38);
    }
    *(float *)(iVar1 + 0x38) = fVar8;
    iVar4 = *(int *)(this + 4);
  }
  if (*(int *)(iVar4 + 0x217c) == 0) {
    local_20 = 1.0;
  }
  else {
    local_20 = *(float *)(*(int *)(iVar4 + 0x217c) + 0x44);
  }
  lVar6 = (longdouble)ComputeConstraintSpeedFactor(this);
  bVar5 = g_bMovementOptimizations == '\0';
  fVar8 = (float)lVar6;
  if (local_20 <= (float)lVar6) {
    fVar8 = local_20;
  }
  *(float *)(*(int *)(this + 8) + 0x38) = fVar8 * *(float *)(*(int *)(this + 8) + 0x38);
  if (bVar5) {
    fVar7 = SQRT(fVar7);
    if (fVar7 != 0.0) {
      iVar4 = *(int *)(this + 8);
      if (*(float *)(iVar4 + 0x38) < fVar7) {
        fVar7 = *(float *)(iVar4 + 0x38) / fVar7;
        goto LAB_00456c05;
      }
    }
  }
  else if (fVar7 != 0.0) {
    iVar4 = *(int *)(this + 8);
    fVar8 = *(float *)(iVar4 + 0x38);
    if (fVar8 * fVar8 < fVar7) {
      fVar7 = fVar8 / SQRT(fVar7);
LAB_00456c05:
      *(float *)(iVar4 + 0x2c) = *(float *)(iVar4 + 0x2c) * fVar7;
      *(float *)(*(int *)(this + 8) + 0x30) = *(float *)(*(int *)(this + 8) + 0x30) * fVar7;
      *(float *)(*(int *)(this + 8) + 0x34) = fVar7 * *(float *)(*(int *)(this + 8) + 0x34);
    }
  }
  iVar4 = *(int *)(this + 4);
LAB_00456c34:
  if (((*(byte *)(iVar4 + 0x150) & 0x28) != 0) || (*(int *)(iVar4 + 0x100) < 1)) {
    *(undefined4 *)(*(int *)(this + 8) + 0x2c) = 0;
    *(undefined4 *)(*(int *)(this + 8) + 0x30) = 0;
    *(undefined4 *)(*(int *)(this + 8) + 0x34) = 0;
  }
  (**(code **)(*(int *)this + 0x4c))(this);
  iVar4 = *(int *)(this + 4);
  if (*(int *)(iVar4 + 0x100) < 1) {
    iVar4 = *(int *)(this + 8);
    *(undefined4 *)(iVar4 + 0x4c) = *(undefined4 *)(iVar4 + 0x58);
    *(undefined4 *)(iVar4 + 0x50) = *(undefined4 *)(iVar4 + 0x5c);
    *(undefined4 *)(iVar4 + 0x54) = *(undefined4 *)(iVar4 + 0x60);
    piVar2 = *(int **)(this + 4);
    iVar4 = piVar2[0x40];
  }
  else {
    iVar1 = *(int *)(this + 8);
    local_18 = *(float *)(iVar4 + 0x1ab0) + *(float *)(iVar1 + 0x4c);
    local_14 = *(float *)(iVar4 + 0x1ab4) + *(float *)(iVar1 + 0x50);
    local_10 = *(float *)(iVar4 + 0x1ab8) + *(float *)(iVar1 + 0x54);
    if ((*(char *)(iVar4 + 0x186) == '\x01') || (*(char *)(iVar4 + 0x186) == '\b')) {
      *(undefined4 *)(iVar1 + 0x54) = 0;
    }
    else {
      lVar6 = (longdouble)
              (**(code **)(*(int *)this + 0x48))
                        (this,&local_18,iVar1 + 0x40,*(undefined4 *)(sv_rollangle._28_4_ + 0x2c),
                         *(undefined4 *)(sv_rollspeed._28_4_ + 0x2c));
      *(float *)(iVar1 + 0x54) = (float)lVar6;
    }
    *(float *)(*(int *)(this + 8) + 0x4c) = local_18;
    *(float *)(*(int *)(this + 8) + 0x50) = local_14;
    piVar2 = *(int **)(this + 4);
    iVar4 = piVar2[0x40];
  }
  if (iVar4 < 1) {
    pcVar3 = *(code **)(*piVar2 + 0x254);
    iVar4 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
    (*pcVar3)(*(undefined4 *)(this + 4),iVar4 + 0x60);
  }
  fVar8 = *(float *)(*(int *)(this + 8) + 0x50);
  if (180.0 < fVar8) {
    *(float *)(*(int *)(this + 8) + 0x50) = fVar8 - 360.0;
  }
  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)