L L4D2node

CTerrorGameMovement::TongueMove

0x004e3090 · 3234 bytes · __thiscall

_ZN19CTerrorGameMovement10TongueMoveEv

Decompiled

undefined (1 param)

/* CTerrorGameMovement::TongueMove() */

undefined4 __thiscall CTerrorGameMovement::TongueMove(CTerrorGameMovement *this)

{
  CBaseEntity *pCVar1;
  code *pcVar2;
  CTongue *this_00;
  int iVar3;
  ITraceFilter *pIVar4;
  uint uVar5;
  Vector *pVVar6;
  Vector *pVVar7;
  int iVar8;
  CBaseEntity *this_01;
  undefined *puVar9;
  longdouble lVar10;
  float fVar11;
  float fVar12;
  float fVar13;
  float fVar14;
  float fVar15;
  float fVar16;
  float fVar17;
  undefined4 uVar18;
  float local_108;
  float local_104;
  float local_fc;
  float local_ec;
  float local_e8;
  float local_e4;
  ITraceFilter *local_d4;
  float local_d0;
  float local_cc;
  float local_c8;
  float local_c4;
  float local_c0;
  float local_bc;
  undefined4 local_b8;
  undefined4 local_b4;
  float local_b0;
  undefined4 local_ac;
  undefined4 local_a8;
  float local_a4;
  float local_a0;
  float local_9c;
  float local_98;
  float local_94;
  float local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  CGameTrace local_70 [20];
  float local_5c;
  float local_50;
  float local_44;
  
  iVar8 = *(int *)(this + 0x810);
  if ((((((iVar8 == 0) || (uVar5 = *(uint *)(iVar8 + 0x33c4), uVar5 == 0xffffffff)) ||
        (puVar9 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
       ((*(uint *)(puVar9 + 8) != uVar5 >> 0xc ||
        (pCVar1 = *(CBaseEntity **)(puVar9 + 4), pCVar1 == (CBaseEntity *)0x0)))) ||
      (uVar5 = *(uint *)(pCVar1 + 0x30bc), uVar5 == 0xffffffff)) ||
     (((puVar9 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc ||
       (*(uint *)(puVar9 + 8) != uVar5 >> 0xc)) ||
      ((*(int *)(puVar9 + 4) == 0 ||
       (this_00 = (CTongue *)
                  __dynamic_cast(*(int *)(puVar9 + 4),&CBaseAbility::typeinfo,&CTongue::typeinfo,0),
       this_00 == (CTongue *)0x0)))))) {
    return 0;
  }
  iVar3 = *(int *)(this + 8);
  fVar12 = *(float *)(iVar3 + 0x9c);
  fVar17 = *(float *)(iVar3 + 0xa4);
  fVar15 = *(float *)(iVar3 + 0xa0);
  uVar18 = 0;
  CTerrorPlayer::GetTongueDestination((CTerrorPlayer *)&local_d0,SUB41(iVar8,0));
  local_e4 = local_d0;
  local_ec = local_cc;
  local_e8 = local_c8;
  iVar3 = CTongue::GetTonguePullDestinationGround(this_00);
  fVar16 = *(float *)(iVar3 + 8);
  if (((((-0.01 < local_d0) && (local_d0 < 0.01)) && (-0.01 < local_cc)) &&
      ((local_cc < 0.01 && (-0.01 < local_c8)))) && (local_c8 < 0.01)) {
    if (((byte)pCVar1[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(pCVar1);
    }
    local_e4 = *(float *)(pCVar1 + 0x2e0);
    local_ec = *(float *)(pCVar1 + 0x2e4);
    local_e8 = *(float *)(pCVar1 + 0x2e8);
  }
  local_c4 = local_e4 - fVar12;
  local_c0 = local_ec - fVar15;
  local_bc = local_e8 - fVar17;
  iVar3 = CBaseEntity::GetGroundEntity(*(CBaseEntity **)(this + 0x810));
  fVar11 = local_c0 * local_c0 + local_c4 * local_c4;
  fVar13 = SQRT(fVar11);
  if (iVar3 == 0) {
    if (local_bc < 0.0) {
      return 0;
    }
    if (0.0 < local_bc) {
      lVar10 = (longdouble)(**(code **)(*(int *)this + 0x38))(this,iVar8,uVar18);
      if ((float)lVar10 != -1.0) {
        local_bc = 0.0;
      }
      fVar11 = local_c0 * local_c0 + local_c4 * local_c4;
LAB_004e3398:
      if (fVar11 < 2304.0) {
        lVar10 = (longdouble)(**(code **)(*(int *)this + 0x38))(this);
        if ((float)lVar10 == -1.0) {
          (**(code **)(*(int *)this + 0x100))(this,0);
          local_fc = 300.0;
          goto LAB_004e3400;
        }
        if ((local_e8 - fVar16 < 200.0) && (local_fc = 10.0, 30.0 < fVar17 - fVar16))
        goto LAB_004e3400;
      }
    }
  }
  else {
    if (50.0 < fVar13) {
      if (0.0 < local_bc) {
        local_bc = 0.0;
      }
      local_fc = 0.0;
      goto LAB_004e3400;
    }
    if (0.0 < local_bc) goto LAB_004e3398;
  }
  local_fc = 0.0;
LAB_004e3400:
  VectorNormalize((Vector *)&local_c4);
  iVar8 = *(int *)(this + 0x810);
  fVar16 = 99999.9;
  if (0.0 < *(float *)(iVar8 + 0x33cc)) {
    lVar10 = (longdouble)IntervalTimer::Now();
    fVar16 = (float)lVar10 - *(float *)(iVar8 + 0x33cc);
  }
  iVar8 = *(int *)(this + 8);
  fVar11 = *(float *)(TongueVictimMaxSpeed._28_4_ + 0x2c);
  fVar14 = 0.0;
  if (*(float *)(TongueStartPullDelay._28_4_ + 0x2c) <= fVar16) {
    fVar14 = SQRT(*(float *)(iVar8 + 0x44) * *(float *)(iVar8 + 0x44) +
                  *(float *)(iVar8 + 0x40) * *(float *)(iVar8 + 0x40) +
                  *(float *)(iVar8 + 0x48) * *(float *)(iVar8 + 0x48)) +
             *(float *)(TongueVictimAcceleration._28_4_ + 0x2c) * *(float *)(gpGlobals + 0x10) *
             fVar11;
    if (fVar11 <= fVar14) {
      fVar14 = fVar11;
    }
    fVar14 = fVar14 * *(float *)(gpGlobals + 0x10);
  }
  local_b4 = *(undefined4 *)(iVar8 + 0xa0);
  local_b8 = *(undefined4 *)(iVar8 + 0x9c);
  if (fVar13 <= fVar14) {
    fVar14 = fVar13;
  }
  local_b0 = *(float *)(iVar8 + 0xa4);
  fVar16 = local_bc * fVar14;
  fVar12 = local_c4 * fVar14 + fVar12;
  fVar15 = fVar14 * local_c0 + fVar15;
  local_a4 = local_b0 - 48.0;
  local_ac = local_b8;
  local_a8 = local_b4;
  pIVar4 = (ITraceFilter *)(**(code **)(*(int *)this + 0x108))(this,8);
  local_d4 = pIVar4;
  uVar5 = (**(code **)(*(int *)this + 0x40))(this,0,0);
  pVVar6 = (Vector *)(**(code **)(*(int *)this + 0x80))(this);
  pVVar7 = (Vector *)(**(code **)(*(int *)this + 0x7c))(this);
  TracePlayerBBoxForGround
            (*(ITraceListData **)(this + 0x7cc),(Vector *)&local_b8,(Vector *)&local_ac,pVVar7,
             pVVar6,uVar5,pIVar4,local_70,0.7,false,(int *)(this + 2000));
  (**(code **)(*(int *)this + 0x10c))(this,&local_d4);
  if ((0.7 <= local_50) && (24.0 < local_b0 - local_5c)) {
    local_ac = local_b8;
    local_a8 = local_b4;
    local_a4 = local_5c;
    if (50.0 >= fVar13) {
      local_a4 = (local_b0 + 24.0) - (local_b0 - local_5c);
    }
    pcVar2 = *(code **)(*(int *)this + 0x3c);
    uVar18 = (**(code **)(*(int *)this + 0x40))(this,0,0);
    (*pcVar2)(this,(Vector *)&local_b8,&local_ac,uVar18,8,local_70);
    if (0.0 < local_44) {
      local_e8 = local_5c;
    }
  }
  fVar11 = *(float *)(gpGlobals + 0x10);
  local_98 = fVar16 + (fVar17 - fVar11 * fVar11 * *(float *)(TongueGravityForce._28_4_ + 0x2c));
  if (0.0 < local_fc) {
    local_98 = fVar11 * local_fc + local_98;
  }
  local_a0 = fVar12;
  local_9c = fVar15;
  fVar12 = local_98;
  if ((((&DAT_000033dc)[*(int *)(this + 0x810)] != '\0') &&
      (lVar10 = (longdouble)(**(code **)(*(int *)this + 0x38))(this), fVar12 = local_98,
      (float)lVar10 != -1.0)) && (fVar12 = fVar17, local_98 <= fVar17)) {
    fVar12 = local_98;
  }
  local_98 = fVar12;
  iVar8 = *(int *)(this + 8);
  fVar17 = local_e4 - local_a0;
  local_94 = local_e4 - *(float *)(iVar8 + 0x9c);
  fVar15 = local_ec - local_9c;
  local_90 = local_ec - *(float *)(iVar8 + 0xa0);
  fVar12 = SQRT(local_94 * local_94 + local_90 * local_90);
  if (fVar12 == 0.0) {
    local_108 = 0.0;
    local_104 = 0.0;
  }
  else {
    local_104 = (1.0 / fVar12) * local_94;
    local_108 = (1.0 / fVar12) * local_90;
  }
  fVar16 = SQRT(fVar15 * fVar15 + fVar17 * fVar17);
  if ((fVar16 == 0.0) || ((fVar15 * local_108 + fVar17 * local_104) / fVar16 <= 0.0)) {
    local_a0 = local_e4;
    local_9c = local_ec;
  }
  else {
    local_94 = local_a0 - *(float *)(iVar8 + 0x9c);
    local_90 = local_9c - *(float *)(iVar8 + 0xa0);
    fVar12 = SQRT(local_90 * local_90 + local_94 * local_94);
  }
  if (local_e8 < local_98) {
    local_98 = local_e8;
  }
  fVar17 = local_98 - *(float *)(iVar8 + 0xa4);
  local_8c = 0;
  if (((local_94 <= -0.01) || (0.01 <= local_94)) || ((local_90 <= -0.01 || (0.01 <= local_90)))) {
    VectorNormalize((Vector *)&local_94);
  }
  fVar15 = *(float *)(TongueVictimMaxSpeed._28_4_ + 0x2c) * *(float *)(gpGlobals + 0x10);
  if (fVar15 <= fVar12) {
    fVar12 = fVar15;
  }
  if (((&DAT_000033dc)[*(int *)(this + 0x810)] == '\0') ||
     (lVar10 = (longdouble)(**(code **)(*(int *)this + 0x38))(this), (float)lVar10 == -1.0)) {
    if (fVar17 < 0.0) {
      iVar8 = *(int *)(this + 8);
      fVar15 = *(float *)(gpGlobals + 0x10) * *(float *)(iVar8 + 0x48);
    }
    else {
      iVar8 = *(int *)(this + 8);
      if (fVar17 <= fVar15) {
        fVar15 = fVar17;
      }
    }
  }
  else {
    fVar15 = local_fc * *(float *)(gpGlobals + 0x10);
    iVar8 = *(int *)(this + 8);
  }
  local_98 = fVar15 + *(float *)(iVar8 + 0xa4);
  local_9c = local_90 * fVar12 + *(float *)(iVar8 + 0xa0);
  local_a0 = fVar12 * local_94 + *(float *)(iVar8 + 0x9c);
  lVar10 = (longdouble)(**(code **)(*(int *)this + 0x38))(this);
  UpdatePosition(this,(Vector *)&local_a0,(float)lVar10);
  fVar12 = *(float *)(*(int *)(this + 8) + 0x48);
  if (0.0 < fVar12) {
    *(float *)(*(int *)(this + 8) + 0x48) = fVar12 * 0.1;
  }
  pCVar1 = *(CBaseEntity **)(this + 0x810);
  this_01 = pCVar1;
  if (((byte)pCVar1[0x14d] & 0x10) != 0) {
    CBaseEntity::CalcAbsoluteVelocity(pCVar1);
    this_01 = *(CBaseEntity **)(this + 0x810);
  }
  local_88 = *(undefined4 *)(pCVar1 + 0x274);
  local_84 = *(undefined4 *)(pCVar1 + 0x278);
  local_80 = *(undefined4 *)(pCVar1 + 0x27c);
  local_7c = local_88;
  local_78 = local_84;
  local_74 = local_80;
  CBaseEntity::SetAbsVelocity(this_01,(Vector *)&local_7c);
  CheckForLedges(this);
  CBaseEntity::SetAbsVelocity(*(CBaseEntity **)(this + 0x810),(Vector *)&local_88);
  return 1;
}

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)