L L4D2node

CTongue::UpdateTongueTarget

0x008465a0 · 1081 bytes · __thiscall

_ZN7CTongue18UpdateTongueTargetEv

Decompiled

undefined (1 param)

/* CTongue::UpdateTongueTarget() */

void __thiscall CTongue::UpdateTongueTarget(CTongue *this)

{
  float fVar1;
  uint uVar2;
  int *piVar3;
  CBaseEdict *this_00;
  int *piVar4;
  char cVar5;
  QAngle *pQVar6;
  undefined *puVar7;
  int iVar8;
  float local_90;
  uint local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined **local_7c;
  int *local_78;
  Vector local_74 [12];
  undefined4 local_68;
  float local_64;
  float local_60;
  float local_5c;
  undefined4 local_58;
  undefined1 local_54;
  CTerrorPlayer *local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  float local_38;
  undefined4 local_34;
  undefined1 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  
  piVar4 = mdlcache;
  uVar2 = *(uint *)(this + 0x44c);
  if ((((uVar2 == 0xffffffff) ||
       (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar7 + 8) != uVar2 >> 0xc)) ||
     (piVar3 = *(int **)(puVar7 + 4), piVar3 == (int *)0x0)) {
    return;
  }
  (**(code **)(*mdlcache + 0x68))(mdlcache);
                    /* try { // try from 008465fd to 00846601 has its CatchHandler @ 008469f9 */
  cVar5 = CTerrorGameRules::HasPlayerControlledZombies();
  if (cVar5 == '\0') {
    local_90 = *(float *)(TongueConeStartTolerance._28_4_ + 0x2c);
  }
  else {
    local_90 = *(float *)(TongueVersusConeStartTolerance._28_4_ + 0x2c);
  }
  local_7c = &PTR_operator___00c22340;
  fVar1 = *(float *)(TongueRange._28_4_ + 0x2c);
  local_4c = 0;
  local_48 = 0;
  local_44 = 0;
  local_40 = 0;
  local_3c = 0;
                    /* try { // try from 00846660 to 00846674 has its CatchHandler @ 00846a35 */
  local_78 = piVar3;
  pQVar6 = (QAngle *)(**(code **)(*piVar3 + 0x238))(piVar3);
  AngleVectors(pQVar6,local_74);
  local_68 = 2;
  local_50 = (CTerrorPlayer *)0x0;
  local_64 = 1.0 - local_90;
  local_58 = 0x42480000;
  local_54 = 0;
  local_38 = fVar1 * fVar1;
  local_7c = &PTR_operator___00cd8008;
  local_34 = 0x7f7fffff;
                    /* try { // try from 008466d4 to 008466f1 has its CatchHandler @ 00846a33 */
  local_60 = local_64;
  local_5c = fVar1;
  local_30 = (**(code **)(*piVar3 + 0x778))(piVar3);
  (**(code **)(*piVar3 + 0x234))(&local_88,piVar3);
  local_2c = local_88;
  local_28 = local_84;
  local_24 = local_80;
                    /* try { // try from 0084671c to 0084689b has its CatchHandler @ 00846a1d */
  ForEachTerrorPlayer<TongueTargetScan<CTerrorPlayer>>((TongueTargetScan *)&local_7c);
  local_90 = 0.0;
  uVar2 = *(uint *)(this + 0x47c);
  if (((uVar2 != 0xffffffff) &&
      (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) {
    local_90 = *(float *)(puVar7 + 4);
  }
  CHandle<CTerrorPlayer>::CHandle((CHandle<CTerrorPlayer> *)&local_8c,local_50);
  if (((local_8c == 0xffffffff) ||
      (puVar7 = g_pEntityList + (local_8c & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar7 + 8) != local_8c >> 0xc)) {
    iVar8 = 0;
  }
  else {
    iVar8 = *(int *)(puVar7 + 4);
  }
  uVar2 = *(uint *)(this + 0x47c);
  if (((uVar2 == 0xffffffff) ||
      (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar7 + 8) != uVar2 >> 0xc)) {
    if (iVar8 != 0) goto LAB_00846900;
  }
  else if (iVar8 != *(int *)(puVar7 + 4)) {
LAB_00846900:
    if (this[0x6c] == (CTongue)0x0) {
      this_00 = *(CBaseEdict **)(this + 0x30);
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
                    /* try { // try from 0084691a to 008469ea has its CatchHandler @ 00846a1d */
        iVar8 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar8 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CTongue)((byte)this[0x70] | 1);
    }
    *(uint *)(this + 0x47c) = local_8c;
  }
  if (((1 < *(int *)(TongueDebug._28_4_ + 0x30)) &&
      (uVar2 = *(uint *)(this + 0x47c), uVar2 != 0xffffffff)) &&
     ((puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc &&
      ((*(uint *)(puVar7 + 8) == uVar2 >> 0xc &&
       (*(CBaseEntity **)(puVar7 + 4) != (CBaseEntity *)0x0)))))) {
    NDebugOverlay::EntityBounds(*(CBaseEntity **)(puVar7 + 4),0xff,0,0,0x32,0.1);
  }
  cVar5 = IsTongueActive(this);
  if (cVar5 != '\0') goto LAB_008468a0;
  uVar2 = *(uint *)(this + 0x47c);
  if (uVar2 == 0xffffffff) {
    if (local_90 == 0.0) goto LAB_008468a0;
  }
  else {
    puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10;
    if ((puVar7 == (undefined *)0xfffffffc) || (*(uint *)(puVar7 + 8) != uVar2 >> 0xc)) {
      iVar8 = 0;
    }
    else {
      iVar8 = *(int *)(puVar7 + 4);
    }
    if (local_90 == (float)iVar8) goto LAB_008468a0;
    puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10;
    if (((puVar7 != (undefined *)0xfffffffc) && (*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) &&
       (*(int *)(puVar7 + 4) != 0)) {
      (**(code **)(*(int *)this + 0x394))(this,local_50,"Tongue targeting new victim.");
      goto LAB_008468a0;
    }
  }
  (**(code **)(*(int *)this + 0x390))(this,"Tongue not targeting anyone.");
LAB_008468a0:
  local_7c = &PTR_operator___00c22340;
  local_40 = 0;
  CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)&local_4c);
  local_3c = local_4c;
  CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)&local_4c);
  (**(code **)(*piVar4 + 0x6c))(piVar4);
  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)