L L4D2node

CTerrorGameMovement::AdjustPosture

0x004fd580 · 794 bytes · __thiscall

_ZN19CTerrorGameMovement13AdjustPostureERK10CGameTraceRK6VectorP12ITraceFilterb

Decompiled

undefined (5 params)

/* CTerrorGameMovement::AdjustPosture(CGameTrace const&, Vector const&, ITraceFilter*, bool) */

void __thiscall
CTerrorGameMovement::AdjustPosture
          (CTerrorGameMovement *this,CGameTrace *param_1,Vector *param_2,ITraceFilter *param_3,
          bool param_4)

{
  int iVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  char cVar4;
  uint uVar5;
  int iVar6;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  float local_80;
  undefined4 local_7c;
  undefined4 local_78;
  float local_74;
  CGameTrace local_70 [12];
  undefined4 local_64;
  undefined4 local_60;
  float local_5c;
  float local_50;
  float local_44;
  char local_39;
  
  if (((*(char *)(*(int *)(this + 4) + 0x1a90) == '\0') &&
      (cVar4 = CTerrorPlayer::IsAutoCrouchEnabled(*(CTerrorPlayer **)(this + 0x810)), cVar4 != '\0')
      ) && (0.01 <= (*(float *)(param_1 + 0x10) - *(float *)(param_2 + 4)) *
                    (*(float *)(param_1 + 0x10) - *(float *)(param_2 + 4)) +
                    (*(float *)(param_1 + 0xc) - *(float *)param_2) *
                    (*(float *)(param_1 + 0xc) - *(float *)param_2))) {
    if (0 < *(int *)(this + 0x7f4)) {
      iVar6 = 0;
      do {
        iVar1 = *(int *)(*(int *)(this + 0x7e8) + iVar6 * 4);
        if ((iVar1 != 0) &&
           (cVar4 = (**(code **)(**(int **)(this + 0x810) + 0x6e4))(*(int **)(this + 0x810),iVar1,0)
           , cVar4 != '\0')) {
          return;
        }
        iVar6 = iVar6 + 1;
      } while (iVar6 < *(int *)(this + 0x7f4));
    }
    iVar6 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
    uVar2 = *(undefined4 *)(iVar6 + 0x2c);
    iVar6 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
    uVar3 = *(undefined4 *)(iVar6 + 0x10);
    iVar6 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
    local_a0 = *(undefined4 *)(iVar6 + 0xc);
    local_9c = uVar3;
    local_98 = uVar2;
    iVar6 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
    uVar2 = *(undefined4 *)(iVar6 + 0x38);
    iVar6 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
    uVar3 = *(undefined4 *)(iVar6 + 0x1c);
    iVar6 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
    local_94 = *(undefined4 *)(iVar6 + 0x18);
    local_88 = *(undefined4 *)param_1;
    local_84 = *(undefined4 *)(param_1 + 4);
    local_80 = *(float *)(param_1 + 8);
    local_7c = *(undefined4 *)param_2;
    local_78 = *(undefined4 *)(param_2 + 4);
    local_74 = *(float *)(param_2 + 8);
    if ((!param_4) && ((*(byte *)(gpGlobals + 0x18) & 1) != 0)) {
      local_80 = local_80 + *(float *)(*(int *)(this + 4) + 0x1acc);
      local_74 = *(float *)(*(int *)(this + 4) + 0x1acc) + local_74;
    }
    local_90 = uVar3;
    local_8c = uVar2;
    uVar5 = (**(code **)(*(int *)this + 0x40))(this,0,0);
    PlayerMovementTraceHull
              (this,(Vector *)&local_88,(Vector *)&local_7c,(Vector *)&local_a0,(Vector *)&local_94,
               uVar5,param_3,local_70);
    if ((1.0 <= local_44) && (local_39 == '\0')) {
      if ((!param_4) && ((*(byte *)(gpGlobals + 0x18) & 1) != 0)) {
        local_80 = local_5c;
        local_74 = local_5c - *(float *)(*(int *)(this + 4) + 0x1acc);
        local_7c = local_64;
        local_78 = local_60;
        local_88 = local_64;
        local_84 = local_60;
        uVar5 = (**(code **)(*(int *)this + 0x40))(this,0,0);
        PlayerMovementTraceHull
                  (this,(Vector *)&local_88,(Vector *)&local_7c,(Vector *)&local_a0,
                   (Vector *)&local_94,uVar5,param_3,local_70);
        if ((local_44 < 1.0) && (local_50 < 0.7)) {
          return;
        }
      }
      CTerrorPlayer::OnAutoCrouch(*(CTerrorPlayer **)(this + 0x810));
    }
  }
  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)