L L4D2node

CTongue::GetTonguePullDestinationGround

0x004e2b40 · 653 bytes · __thiscall

_ZN7CTongue30GetTonguePullDestinationGroundEv

Decompiled

undefined (1 param)

/* CTongue::GetTonguePullDestinationGround() */

CTongue * __thiscall CTongue::GetTonguePullDestinationGround(CTongue *this)

{
  float fVar1;
  uint uVar2;
  int *piVar3;
  CTongue *pCVar4;
  undefined *puVar5;
  CBaseEntity *pCVar6;
  undefined **local_dc [4];
  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;
  Vector local_70 [12];
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  
  pCVar4 = (CTongue *)&vec3_origin;
  uVar2 = *(uint *)(this + 0x44c);
  if ((((uVar2 != 0xffffffff) &&
       (puVar5 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar5 + 8) == uVar2 >> 0xc)) &&
     (pCVar6 = *(CBaseEntity **)(puVar5 + 4), pCVar6 != (CBaseEntity *)0x0)) {
    if (*(int *)(this + 0x534) == 0) {
      if (((byte)pCVar6[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(pCVar6);
      }
      pCVar6 = pCVar6 + 0x2e0;
    }
    else {
      pCVar6 = (CBaseEntity *)(this + (*(int *)(this + 0x534) * 3 + -3) * 4 + 0x4bc);
    }
    if (((*(float *)pCVar6 != *(float *)(this + 0x574)) ||
        (*(float *)(this + 0x578) != *(float *)(pCVar6 + 4))) ||
       (pCVar4 = this + 0x580, *(float *)(this + 0x57c) != *(float *)(pCVar6 + 8))) {
      *(float *)(this + 0x574) = *(float *)pCVar6;
      *(float *)(this + 0x578) = *(float *)(pCVar6 + 4);
      *(float *)(this + 0x57c) = *(float *)(pCVar6 + 8);
      CTraceFilterSimple::CTraceFilterSimple
                ((CTraceFilterSimple *)local_dc,(IHandleEntity *)0x0,0,
                 (_func_bool_IHandleEntity_ptr_int *)0x0);
      piVar3 = enginetrace;
      local_dc[0] = &PTR_ShouldHitEntity_00c54558;
      local_bc = *(float *)pCVar6;
      *(float *)(this + 0x580) = local_bc;
      local_b8 = *(float *)(pCVar6 + 4);
      *(float *)(this + 0x584) = local_b8;
      fVar1 = *(float *)(pCVar6 + 8);
      *(float *)(this + 0x588) = fVar1 - 1000.0;
      local_bc = local_bc - *(float *)pCVar6;
      local_b8 = local_b8 - *(float *)(pCVar6 + 4);
      local_b4 = (fVar1 - 1000.0) - *(float *)(pCVar6 + 8);
      local_88 = 1;
      local_8c = 0;
      local_94 = 0;
      local_98 = 0;
      local_9c = 0;
      local_87 = local_bc * local_bc + local_b8 * local_b8 + local_b4 * local_b4 != 0.0;
      local_a4 = 0;
      local_a8 = 0;
      local_ac = 0;
      local_cc = *(float *)pCVar6;
      local_c8 = *(float *)(pCVar6 + 4);
      local_c4 = *(float *)(pCVar6 + 8);
      (**(code **)(*piVar3 + 0x14))
                (piVar3,&local_cc,0x201420b,(CTraceFilterSimple *)local_dc,local_70);
      if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
        DebugDrawLine(local_70,(Vector *)&local_64,0xff,0,0,true,-1.0);
      }
      *(undefined4 *)(this + 0x580) = local_64;
      *(undefined4 *)(this + 0x584) = local_60;
      *(undefined4 *)(this + 0x588) = local_5c;
      return this + 0x580;
    }
  }
  return pCVar4;
}

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)