L L4D2node

CTerrorPlayer::OnStopHangingFromTongue

0x00843170 · 757 bytes · __thiscall

_ZN13CTerrorPlayer23OnStopHangingFromTongueEi

Decompiled

undefined (2 params)

/* CTerrorPlayer::OnStopHangingFromTongue(int) */

void __thiscall CTerrorPlayer::OnStopHangingFromTongue(CTerrorPlayer *this,int param_1)

{
  uint uVar1;
  CBaseEdict *pCVar2;
  code *pcVar3;
  char cVar4;
  int iVar5;
  int *piVar6;
  undefined4 uVar7;
  undefined *puVar8;
  longdouble lVar9;
  
  uVar1 = *(uint *)(this + 0x33e0);
  *(uint *)(this + 0x33e0) = ~param_1 & uVar1;
  if ((this[0x33dc] != (CTerrorPlayer)0x0) && ((~param_1 & uVar1) == 0)) {
    if (this[0x6c] == (CTerrorPlayer)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar5 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar5 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
    }
    this[0x33dc] = (CTerrorPlayer)0x0;
    if (this[0x33dd] != (CTerrorPlayer)0x0) {
      if (this[0x6c] == (CTerrorPlayer)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar5 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar5 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
      }
      this[0x33dd] = (CTerrorPlayer)0x0;
    }
    if (param_1 == 3) {
      iVar5 = CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
      if (iVar5 != 0) {
        iVar5 = CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
        if ((*(byte *)(iVar5 + 0xd4) & 0x20) != 0) {
          piVar6 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
          (**(code **)(*piVar6 + 0x424))(piVar6);
          cVar4 = (**(code **)(*(int *)this + 0x7e8))(this);
          if (cVar4 == '\0') {
            lVar9 = (longdouble)CountdownTimer::Now();
            if ((float)lVar9 + 2.0 != *(float *)(this + 0x2e68)) {
              (**(code **)(*(int *)(this + 0x2e60) + 4))(this + 0x2e60,this + 0x2e68);
              *(float *)(this + 0x2e68) = (float)lVar9 + 2.0;
            }
            if (*(float *)(this + 0x2e64) != 2.0) {
              (**(code **)(*(int *)(this + 0x2e60) + 4))(this + 0x2e60,this + 0x2e64);
              *(undefined4 *)(this + 0x2e64) = 0x40000000;
            }
          }
          else {
            cVar4 = CCSPlayer::HasSecondaryWeapon((CCSPlayer *)this);
            if (cVar4 != '\0') {
              pcVar3 = *(code **)(*(int *)this + 0x474);
              uVar7 = (**(code **)(*(int *)this + 0x484))(this,1);
              (*pcVar3)(this,uVar7,0);
            }
          }
        }
      }
    }
    piVar6 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"choke_end",0,0);
    if (piVar6 != (int *)0x0) {
      uVar1 = *(uint *)(this + 0x33c4);
      if ((((uVar1 != 0xffffffff) &&
           (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
          (*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar8 + 4) != 0)) {
        pcVar3 = *(code **)(*piVar6 + 0x30);
        uVar7 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(*(int *)(puVar8 + 4) + 0x30));
        (*pcVar3)(piVar6,"userid",uVar7);
      }
      pcVar3 = *(code **)(*piVar6 + 0x30);
      uVar7 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this + 0x30));
      (*pcVar3)(piVar6,"victim",uVar7);
      (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar6,0);
    }
    uVar1 = *(uint *)(this + 0x33c4);
    if (((uVar1 != 0xffffffff) &&
        (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
       ((*(uint *)(puVar8 + 8) == uVar1 >> 0xc &&
        (*(CTerrorPlayer **)(puVar8 + 4) != (CTerrorPlayer *)0x0)))) {
      AbilityDebug(*(CTerrorPlayer **)(puVar8 + 4),this,"Tongue choke ending.");
    }
  }
  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)