L L4D2node

CTerrorGameMovement::CheckLungeButton

0x004fc250 · 3164 bytes · __thiscall

_ZN19CTerrorGameMovement16CheckLungeButtonEv

Decompiled

undefined (1 param)

/* CTerrorGameMovement::CheckLungeButton() */

void __thiscall CTerrorGameMovement::CheckLungeButton(CTerrorGameMovement *this)

{
  uint uVar1;
  code *pcVar2;
  CBaseEdict *pCVar3;
  char cVar4;
  CTerrorPlayer *this_00;
  float *pfVar5;
  undefined4 uVar6;
  int iVar7;
  int iVar8;
  int *piVar9;
  CBaseEntity *pCVar10;
  undefined *puVar11;
  longdouble lVar12;
  float fVar13;
  float fVar14;
  float fVar15;
  float fVar16;
  float local_e0;
  float local_dc;
  float local_d8;
  float local_d4;
  int local_d0;
  float local_b8;
  float local_b4;
  float local_b0;
  float local_ac;
  float local_a8;
  float local_a4;
  float local_a0;
  float local_9c;
  float local_98;
  float local_94;
  float local_90;
  float local_8c;
  float local_88;
  float local_84;
  float local_80;
  float local_7c;
  float local_78;
  float local_74;
  undefined1 local_70 [12];
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  float local_44;
  char local_39;
  CBaseEntity *local_24;
  
  this_00 = *(CTerrorPlayer **)(this + 0x810);
  if ((this_00 != (CTerrorPlayer *)0x0) &&
     ((((*(float *)(this_00 + 0x3394) <= -0.01 || (0.01 <= *(float *)(this_00 + 0x3394))) ||
       (*(float *)(this_00 + 0x3398) <= -0.01)) ||
      (((0.01 <= *(float *)(this_00 + 0x3398) || (*(float *)(this_00 + 0x339c) <= -0.01)) ||
       (0.01 <= *(float *)(this_00 + 0x339c))))))) {
    uVar1 = *(uint *)(this_00 + 0x3e68);
    if (((uVar1 == 0xffffffff) ||
        (puVar11 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar11 == (undefined *)0xfffffffc)) ||
       ((*(uint *)(puVar11 + 8) != uVar1 >> 0xc || (*(int *)(puVar11 + 4) == 0)))) {
      uVar1 = *(uint *)(this_00 + 0x3e64);
      if ((((uVar1 == 0xffffffff) ||
           (puVar11 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar11 == (undefined *)0xfffffffc))
          || (*(uint *)(puVar11 + 8) != uVar1 >> 0xc)) || (*(int *)(puVar11 + 4) == 0)) {
        if ((*(CBaseEntity **)(this + 4))[0x186] == (CBaseEntity)0x9) {
          CBaseEntity::SetMoveType(*(CBaseEntity **)(this + 4),2,0);
          iVar8 = *(int *)(this + 4);
          if (*(char *)(iVar8 + 0x187) != '\0') {
            if (*(char *)(iVar8 + 0x6c) == '\0') {
              pCVar3 = *(CBaseEdict **)(iVar8 + 0x30);
              if (pCVar3 != (CBaseEdict *)0x0) {
                *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
                iVar7 = CBaseEdict::GetChangeAccessor(pCVar3);
                *(undefined2 *)(iVar7 + 2) = 0;
              }
            }
            else {
              *(byte *)(iVar8 + 0x70) = *(byte *)(iVar8 + 0x70) | 1;
            }
            *(undefined1 *)(iVar8 + 0x187) = 0;
          }
          this_00 = *(CTerrorPlayer **)(this + 0x810);
        }
        CTerrorPlayer::SetShoveForce(this_00,(Vector *)&vec3_origin);
        return;
      }
    }
    else {
      CTerrorPlayer::SetShoveForce(this_00,(Vector *)&vec3_origin);
      this_00 = *(CTerrorPlayer **)(this + 0x810);
    }
  }
  uVar1 = *(uint *)(this_00 + 0x30bc);
  if (((uVar1 == 0xffffffff) ||
      (puVar11 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar11 == (undefined *)0xfffffffc)) ||
     ((*(uint *)(puVar11 + 8) != uVar1 >> 0xc ||
      (piVar9 = *(int **)(puVar11 + 4), piVar9 == (int *)0x0)))) {
    if (this_00[0x1c80] != (CTerrorPlayer)0x0) {
LAB_004fc3a0:
      *(uint *)(*(int *)(this + 8) + 0x28) = *(uint *)(*(int *)(this + 8) + 0x28) | 1;
      return;
    }
    piVar9 = (int *)0x0;
    pfVar5 = (float *)0x0;
LAB_004fc488:
    if (2 < *(byte *)(*(int *)(this + 4) + 0x253)) {
LAB_004fc497:
      if ((pfVar5 != (float *)0x0) &&
         (((((*pfVar5 <= -0.01 || (0.01 <= *pfVar5)) || (pfVar5[1] <= -0.01)) ||
           ((0.01 <= pfVar5[1] || (pfVar5[2] <= -0.01)))) || (0.01 <= pfVar5[2])))) {
        *pfVar5 = 0.0;
        pfVar5[1] = 0.0;
        pfVar5[2] = 0.0;
        return;
      }
      return;
    }
    if (piVar9 == (int *)0x0) {
      return;
    }
  }
  else {
    pfVar5 = (float *)(**(code **)(*piVar9 + 0x35c))(piVar9,1);
    if (*(int *)(this + 0x810) != 0) {
      if (*(char *)(*(int *)(this + 0x810) + 0x1c80) != '\0') {
        if ((pfVar5 != (float *)0x0) &&
           (((*pfVar5 <= -0.01 || (0.01 <= *pfVar5)) ||
            ((pfVar5[1] <= -0.01 ||
             (((0.01 <= pfVar5[1] || (pfVar5[2] <= -0.01)) || (0.01 <= pfVar5[2])))))))) {
          *pfVar5 = 0.0;
          pfVar5[1] = 0.0;
          pfVar5[2] = 0.0;
        }
        goto LAB_004fc3a0;
      }
      goto LAB_004fc488;
    }
    if (2 < *(byte *)(*(int *)(this + 4) + 0x253)) goto LAB_004fc497;
  }
  if (pfVar5 == (float *)0x0) {
    return;
  }
  local_b8 = *pfVar5;
  if (local_b8 <= -0.01) {
    local_b4 = pfVar5[1];
LAB_004fc547:
    local_b0 = pfVar5[2];
  }
  else {
    local_b4 = pfVar5[1];
    if ((0.01 <= local_b8) || (local_b4 <= -0.01)) goto LAB_004fc547;
    local_b0 = pfVar5[2];
    if (((local_b4 < 0.01) && (-0.01 < local_b0)) && (local_b0 < 0.01)) {
      return;
    }
  }
  pfVar5[2] = 0.0;
  pfVar5[1] = 0.0;
  *pfVar5 = 0.0;
  pCVar10 = *(CBaseEntity **)(this + 4);
  if (pCVar10[0x186] == (CBaseEntity)0x9) {
    CBaseEntity::SetMoveType(pCVar10,2,0);
    pCVar10 = *(CBaseEntity **)(this + 4);
    if (pCVar10[0x187] != (CBaseEntity)0x0) {
      if (pCVar10[0x6c] == (CBaseEntity)0x0) {
        pCVar3 = *(CBaseEdict **)(pCVar10 + 0x30);
        if (pCVar3 != (CBaseEdict *)0x0) {
          *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
          iVar8 = CBaseEdict::GetChangeAccessor(pCVar3);
          *(undefined2 *)(iVar8 + 2) = 0;
        }
      }
      else {
        pCVar10[0x70] = (CBaseEntity)((byte)pCVar10[0x70] | 1);
      }
      pCVar10[0x187] = (CBaseEntity)0x0;
      pCVar10 = *(CBaseEntity **)(this + 4);
    }
  }
  if (pCVar10[0x1a90] != (CBaseEntity)0x0) {
    iVar8 = *(int *)(this + 8);
    local_7c = *(float *)(iVar8 + 0x9c);
    local_78 = *(float *)(iVar8 + 0xa0);
    local_74 = *(float *)(iVar8 + 0xa4) + 20.0;
    pcVar2 = *(code **)(*(int *)this + 0x3c);
    uVar6 = (**(code **)(*(int *)this + 0x40))(this,0,0);
    (*pcVar2)(this,*(int *)(this + 8) + 0x9c,&local_7c,uVar6,8,local_70);
    if (0.0 < local_44) {
      iVar8 = *(int *)(this + 8);
      *(undefined4 *)(iVar8 + 0x9c) = local_64;
      *(undefined4 *)(iVar8 + 0xa0) = local_60;
      *(undefined4 *)(iVar8 + 0xa4) = local_5c;
    }
  }
  lVar12 = (longdouble)AngleNormalize(*(float *)(*(int *)(this + 8) + 0x18));
  if (-20.0 < (float)lVar12) {
    AngleVectors((QAngle *)(*(int *)(this + 8) + 0x18),(Vector *)&local_ac,(Vector *)&local_a0,
                 (Vector *)&local_94);
    if ((((local_94 <= -0.01) || (0.01 <= local_94)) || (local_90 <= -0.01)) ||
       (((0.01 <= local_90 || (local_8c <= -0.01)) || (0.01 <= local_8c)))) {
      VectorNormalize((Vector *)&local_94);
      iVar8 = *(int *)(this + 8);
      fVar13 = 0.0;
      local_d0 = 9;
      local_d4 = 0.0;
      local_88 = *(float *)(iVar8 + 0x9c);
      local_84 = *(float *)(iVar8 + 0xa0);
      local_80 = *(float *)(iVar8 + 0xa4);
      local_e0 = local_88;
      local_dc = local_84;
      local_d8 = local_80;
LAB_004fc73b:
      fVar16 = local_94 * fVar13;
      fVar15 = local_90 * fVar13;
      fVar14 = fVar13 * local_8c;
      local_88 = local_88 + fVar16;
      local_84 = local_84 + fVar15;
      local_80 = local_80 + fVar14;
      pcVar2 = *(code **)(*(int *)this + 0x3c);
      uVar6 = (**(code **)(*(int *)this + 0x40))(this,0,0);
      (*pcVar2)(this,*(int *)(this + 8) + 0x9c,&local_88,uVar6,8,local_70);
      if ((local_39 == '\0') && (0.0 < local_44)) {
        iVar8 = *(int *)(this + 8);
        local_88 = fVar16 * local_44 + *(float *)(iVar8 + 0x9c);
        local_84 = fVar15 * local_44 + *(float *)(iVar8 + 0xa0);
        local_80 = fVar14 * local_44 + *(float *)(iVar8 + 0xa4);
        local_7c = local_ac * 128.0 + local_88;
        local_78 = local_a8 * 128.0 + local_84;
        local_74 = local_a4 * 128.0 + local_80;
        pcVar2 = *(code **)(*(int *)this + 0x3c);
        uVar6 = (**(code **)(*(int *)this + 0x40))(this,0,0);
        (*pcVar2)(this,&local_88,&local_7c,uVar6,8,local_70);
        if (local_39 == '\0') {
          if (local_24 != (CBaseEntity *)0x0) {
            cVar4 = (**(code **)(*(int *)local_24 + 0x16c))(local_24);
            if (cVar4 != '\0') {
              iVar8 = CBaseEntity::GetTeamNumber(local_24);
              cVar4 = IsASurvivorTeam(iVar8);
              if (cVar4 != '\0') {
                local_d4 = 1.0;
                local_e0 = local_88;
                local_dc = local_84;
                local_d8 = local_80;
LAB_004fc99d:
                if (local_d4 < 1.0) {
                  VectorNormalize((Vector *)&local_a0);
                  fVar13 = -32.0;
                  local_d0 = 9;
                  do {
                    iVar8 = *(int *)(this + 8);
                    fVar16 = local_a0 * fVar13;
                    fVar15 = local_9c * fVar13;
                    fVar14 = fVar13 * local_98;
                    local_88 = fVar16 + *(float *)(iVar8 + 0x9c);
                    local_84 = fVar15 + *(float *)(iVar8 + 0xa0);
                    local_80 = fVar14 + *(float *)(iVar8 + 0xa4);
                    pcVar2 = *(code **)(*(int *)this + 0x3c);
                    uVar6 = (**(code **)(*(int *)this + 0x40))(this,0,0);
                    (*pcVar2)(this,*(int *)(this + 8) + 0x9c,&local_88,uVar6,8,local_70);
                    if ((local_39 == '\0') && (0.0 < local_44)) {
                      iVar8 = *(int *)(this + 8);
                      local_88 = fVar16 * local_44 + *(float *)(iVar8 + 0x9c);
                      local_84 = fVar15 * local_44 + *(float *)(iVar8 + 0xa0);
                      local_80 = fVar14 * local_44 + *(float *)(iVar8 + 0xa4);
                      local_7c = local_ac * 128.0 + local_88;
                      local_78 = local_a8 * 128.0 + local_84;
                      local_74 = local_a4 * 128.0 + local_80;
                      pcVar2 = *(code **)(*(int *)this + 0x3c);
                      uVar6 = (**(code **)(*(int *)this + 0x40))(this,0,0);
                      (*pcVar2)(this,&local_88,&local_7c,uVar6,8,local_70);
                      if (local_39 == '\0') {
                        if (local_24 != (CBaseEntity *)0x0) {
                          cVar4 = (**(code **)(*(int *)local_24 + 0x16c))(local_24);
                          if (cVar4 != '\0') {
                            iVar8 = CBaseEntity::GetTeamNumber(local_24);
                            cVar4 = IsASurvivorTeam(iVar8);
                            if (cVar4 != '\0') {
                              local_d4 = 1.0;
                              local_e0 = local_88;
                              local_dc = local_84;
                              local_d8 = local_80;
                              break;
                            }
                          }
                          if (local_39 != '\0') goto LAB_004fcc68;
                        }
                        if (local_d4 < local_44) {
                          local_e0 = local_88;
                          local_dc = local_84;
                          local_d8 = local_80;
                          local_d4 = local_44;
                          if (local_44 == 1.0) break;
                        }
                      }
                    }
LAB_004fcc68:
                    local_d0 = local_d0 + -1;
                    fVar13 = fVar13 + 8.0;
                  } while (local_d0 != 0);
                }
                if (0.0 < local_d4) {
                  iVar8 = *(int *)(this + 8);
                  *(float *)(iVar8 + 0x9c) = local_e0;
                  *(float *)(iVar8 + 0xa0) = local_dc;
                  *(float *)(iVar8 + 0xa4) = local_d8;
                }
                goto LAB_004fc5be;
              }
            }
            if (local_39 != '\0') goto LAB_004fc988;
          }
          if (local_d4 < local_44) {
            local_e0 = local_88;
            local_dc = local_84;
            local_d8 = local_80;
            local_d4 = local_44;
            if (local_44 == 1.0) goto LAB_004fc99d;
          }
        }
      }
LAB_004fc988:
      local_d0 = local_d0 + -1;
      fVar13 = fVar13 + 8.0;
      if (local_d0 == 0) goto LAB_004fc99d;
      iVar8 = *(int *)(this + 8);
      local_88 = *(float *)(iVar8 + 0x9c);
      local_84 = *(float *)(iVar8 + 0xa0);
      local_80 = *(float *)(iVar8 + 0xa4);
      goto LAB_004fc73b;
    }
  }
LAB_004fc5be:
  DoJump(this,(Vector *)&local_b8);
  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)