L L4D2node

CTongue::UpdateBend

0x00840f20 · 1783 bytes · __thiscall

_ZN7CTongue10UpdateBendEv

Decompiled

undefined (1 param)

/* CTongue::UpdateBend() */

undefined4 __thiscall CTongue::UpdateBend(CTongue *this)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  uint uVar5;
  int iVar6;
  CBaseEdict *this_00;
  int *piVar7;
  undefined4 uVar8;
  int iVar9;
  undefined *puVar10;
  CTongue *pCVar11;
  longdouble lVar12;
  char *pcVar13;
  float *pfVar14;
  float local_140;
  float local_138;
  float local_134;
  float local_130;
  undefined **local_12c [4];
  float local_11c;
  float local_118;
  float local_114;
  float local_10c;
  float local_108;
  float local_104;
  undefined4 local_fc;
  undefined4 local_f8;
  undefined4 local_f4;
  undefined4 local_ec;
  undefined4 local_e8;
  undefined4 local_e4;
  undefined4 local_dc;
  undefined1 local_d8;
  undefined1 local_d7;
  float local_cc;
  float local_c8;
  float local_c4;
  float local_bc;
  float local_b8;
  float local_b4;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_8c;
  undefined1 local_88;
  undefined1 local_87;
  float local_70;
  float local_6c;
  float local_68;
  Vector local_64 [32];
  float local_44;
  int local_24;
  
  piVar7 = mdlcache;
  uVar5 = *(uint *)(this + 0x44c);
  if (((((uVar5 == 0xffffffff) ||
        (puVar10 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
       (*(uint *)(puVar10 + 8) != uVar5 >> 0xc)) ||
      ((*(int *)(puVar10 + 4) == 0 ||
       (uVar5 = *(uint *)(*(int *)(puVar10 + 4) + 0x33c0), uVar5 == 0xffffffff)))) ||
     ((puVar10 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc ||
      ((*(uint *)(puVar10 + 8) != uVar5 >> 0xc || (iVar6 = *(int *)(puVar10 + 4), iVar6 == 0)))))) {
    return 1;
  }
  (**(code **)(*mdlcache + 0x68))(mdlcache);
  iVar9 = *(int *)(this + 0x534);
  local_138 = *(float *)(this + 0x550) - *(float *)(this + 0x4a0);
  local_134 = *(float *)(this + 0x554) - *(float *)(this + 0x4a4);
  local_130 = *(float *)(this + 0x558) - *(float *)(this + 0x4a8);
                    /* try { // try from 0084101d to 008410e1 has its CatchHandler @ 00841641 */
  lVar12 = (longdouble)VectorNormalize((Vector *)&local_138);
  local_140 = 0.0;
  if (0.0 <= (float)lVar12) {
    do {
      pfVar14 = &local_138;
      local_6c = local_134 * local_140 + *(float *)(this + 0x4a4);
      local_68 = local_130 * local_140 + *(float *)(this + 0x4a8);
      local_70 = local_138 * local_140 + *(float *)(this + 0x4a0);
      pcVar13 = (char *)&local_70;
      uVar8 = TestBend((Vector *)this,(Vector *)&local_70);
      if ((char)uVar8 != '\0') goto LAB_008410ec;
      local_140 = local_140 + 2.0;
    } while (local_140 <= (float)lVar12);
  }
  pfVar14 = &local_138;
  pcVar13 = (char *)(this + 0x4a0);
                    /* try { // try from 00841127 to 0084112b has its CatchHandler @ 00841641 */
  uVar8 = TestBend((Vector *)this,(Vector *)pcVar13);
  if (((((char)uVar8 == '\0') && (*(int *)(this + 0x534) == iVar9)) && (0 < iVar9)) &&
     (*(int *)(TongueUnbend._28_4_ + 0x30) != 0)) {
                    /* try { // try from 00841171 to 008415e6 has its CatchHandler @ 00841629 */
    CTraceFilterSimple::CTraceFilterSimple
              ((CTraceFilterSimple *)local_12c,(IHandleEntity *)0x0,0,
               (_func_bool_IHandleEntity_ptr_int *)0x0);
    local_12c[0] = &PTR_ShouldHitEntity_00c54558;
    iVar9 = *(int *)(this + 0x534);
    if (iVar9 < 2) {
      pCVar11 = this + 0x544;
    }
    else {
      pCVar11 = this + (iVar9 * 3 + -6) * 4 + 0x4bc;
    }
    fVar1 = *(float *)pCVar11;
    fVar2 = *(float *)(pCVar11 + 4);
    fVar3 = *(float *)(pCVar11 + 8);
    pCVar11 = this + (iVar9 * 3 + -3) * 4 + 0x4bc;
    local_134 = *(float *)(this + 0x554) - *(float *)(pCVar11 + 4);
    local_130 = *(float *)(this + 0x558) - *(float *)(pCVar11 + 8);
    local_138 = *(float *)(this + 0x550) - *(float *)pCVar11;
    lVar12 = (longdouble)VectorNormalize((Vector *)&local_138);
    fVar4 = (float)lVar12;
    local_140 = 0.0;
    if (0.0 <= fVar4) {
      do {
        local_d8 = 1;
        local_e4 = 0;
        local_e8 = 0;
        local_ec = 0;
        local_dc = 0;
        pCVar11 = this + (*(int *)(this + 0x534) * 3 + -3) * 4 + 0x4bc;
        local_f4 = 0;
        local_f8 = 0;
        local_fc = 0;
        local_10c = (*(float *)pCVar11 - fVar1) + local_140 * local_138;
        local_104 = (*(float *)(pCVar11 + 8) - fVar3) + local_130 * local_140;
        local_108 = (*(float *)(pCVar11 + 4) - fVar2) + local_134 * local_140;
        local_d7 = local_108 * local_108 + local_10c * local_10c + local_104 * local_104 != 0.0;
        pcVar13 = (char *)&local_11c;
        pfVar14 = (float *)0x2006083;
        local_11c = fVar1;
        local_118 = fVar2;
        local_114 = fVar3;
        (**(code **)(*enginetrace + 0x14))
                  (enginetrace,pcVar13,0x2006083,local_12c,(Vector *)&local_70);
        if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
          pcVar13 = (char *)local_64;
          pfVar14 = (float *)0xff;
          DebugDrawLine((Vector *)&local_70,(Vector *)pcVar13,0xff,0,0,true,-1.0);
        }
        if ((local_44 < 1.0) && (local_24 != iVar6)) goto LAB_008410ec;
        local_140 = local_140 + 2.0;
      } while (local_140 <= fVar4);
    }
    local_94 = 0;
    local_88 = 1;
    local_98 = 0;
    local_9c = 0;
    local_8c = 0;
    local_a4 = 0;
    local_a8 = 0;
    local_ac = 0;
    pCVar11 = this + (*(int *)(this + 0x534) * 3 + -3) * 4 + 0x4bc;
    local_b8 = (local_134 * fVar4 + *(float *)(pCVar11 + 4)) - fVar2;
    local_bc = (local_138 * fVar4 + *(float *)pCVar11) - fVar1;
    local_b4 = (local_130 * fVar4 + *(float *)(pCVar11 + 8)) - fVar3;
    local_87 = local_bc * local_bc + local_b8 * local_b8 + local_b4 * local_b4 != 0.0;
    pcVar13 = (char *)&local_cc;
    pfVar14 = (float *)0x2006083;
    local_cc = fVar1;
    local_c8 = fVar2;
    local_c4 = fVar3;
    (**(code **)(*enginetrace + 0x14))(enginetrace,pcVar13,0x2006083,local_12c,(Vector *)&local_70);
    if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
      pcVar13 = (char *)local_64;
      pfVar14 = (float *)0xff;
      DebugDrawLine((Vector *)&local_70,(Vector *)pcVar13,0xff,0,0,true,-1.0);
    }
    if ((1.0 <= local_44) || (local_24 == iVar6)) {
      pcVar13 = "Unbending!";
      (**(code **)(*(int *)this + 0x390))(this,"Unbending!");
      iVar6 = *(int *)(this + 0x534);
      if (this[0x6c] == (CTongue)0x0) {
        this_00 = *(CBaseEdict **)(this + 0x30);
        if (this_00 != (CBaseEdict *)0x0) {
          *(uint *)this_00 = *(uint *)this_00 | 0x101;
          iVar9 = CBaseEdict::GetChangeAccessor(this_00);
          *(undefined2 *)(iVar9 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTongue)((byte)this[0x70] | 1);
      }
      *(int *)(this + 0x534) = iVar6 + -1;
    }
  }
LAB_008410ec:
  (**(code **)(*piVar7 + 0x6c))(piVar7,pcVar13,pfVar14);
  return uVar8;
}

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)