L L4D2node

CTerrorPlayer::ReleaseTongueVictim

0x009a5640 · 674 bytes · __thiscall

_ZN13CTerrorPlayer19ReleaseTongueVictimEb

Decompiled

undefined (2 params)

/* CTerrorPlayer::ReleaseTongueVictim(bool) */

void __thiscall CTerrorPlayer::ReleaseTongueVictim(CTerrorPlayer *this,bool param_1)

{
  uint uVar1;
  code *pcVar2;
  int *piVar3;
  undefined4 uVar4;
  undefined *puVar5;
  CTerrorPlayer *this_00;
  CBaseEntity *this_01;
  bool bVar6;
  CTongue *local_24;
  
  uVar1 = *(uint *)(this + 0x33c0);
  if (((uVar1 == 0xffffffff) ||
      (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar5 + 8) != uVar1 >> 0xc)) {
    bVar6 = true;
    this_01 = (CBaseEntity *)0x0;
  }
  else {
    this_01 = *(CBaseEntity **)(puVar5 + 4);
    bVar6 = this_01 == (CBaseEntity *)0x0;
  }
  bVar6 = (bool)(bVar6 & !param_1);
  if (!bVar6) {
    uVar1 = *(uint *)(this + 0x30bc);
    local_24 = (CTongue *)0x0;
    if (((uVar1 != 0xffffffff) &&
        (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
       ((*(uint *)(puVar5 + 8) == uVar1 >> 0xc && (*(int *)(puVar5 + 4) != 0)))) {
      local_24 = (CTongue *)
                 __dynamic_cast(*(int *)(puVar5 + 4),&CBaseAbility::typeinfo,&CTongue::typeinfo,0);
      bVar6 = local_24 != (CTongue *)0x0 && this_01 != (CBaseEntity *)0x0;
      if (local_24 != (CTongue *)0x0 && this_01 != (CBaseEntity *)0x0) {
        CTongue::ResetTongueTimer(local_24);
      }
    }
    piVar3 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"tongue_release",0,0);
    if (piVar3 != (int *)0x0) {
      pcVar2 = *(code **)(*piVar3 + 0x30);
      uVar4 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this + 0x30));
      (*pcVar2)(piVar3,"userid",uVar4);
      pcVar2 = *(code **)(*piVar3 + 0x30);
      uVar4 = 0;
      if (this_01 != (CBaseEntity *)0x0) {
        uVar4 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this_01 + 0x30));
      }
      (*pcVar2)(piVar3,"victim",uVar4);
      if (bVar6) {
        if (((byte)this_01[0x14d] & 8) != 0) {
          CBaseEntity::CalcAbsolutePosition(this_01);
        }
        (**(code **)(*piVar3 + 0x30))
                  (piVar3,"distance",
                   (int)SQRT((*(float *)(local_24 + 0x594) - *(float *)(this_01 + 0x2e8)) *
                             (*(float *)(local_24 + 0x594) - *(float *)(this_01 + 0x2e8)) +
                             (*(float *)(local_24 + 0x58c) - *(float *)(this_01 + 0x2e0)) *
                             (*(float *)(local_24 + 0x58c) - *(float *)(this_01 + 0x2e0)) +
                             (*(float *)(local_24 + 0x590) - *(float *)(this_01 + 0x2e4)) *
                             (*(float *)(local_24 + 0x590) - *(float *)(this_01 + 0x2e4))));
      }
      else {
        (**(code **)(*piVar3 + 0x30))(piVar3,"distance",0);
      }
      (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar3,0);
    }
    if (this_01 != (CBaseEntity *)0x0) {
      uVar1 = *(uint *)(this + 0x33c0);
      this_00 = (CTerrorPlayer *)0x0;
      if (((uVar1 != 0xffffffff) &&
          (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) {
        this_00 = *(CTerrorPlayer **)(puVar5 + 4);
      }
      OnReleasedByTongue(this_00);
    }
    OnReleasingWithTongue(this);
    return;
  }
  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)