L L4D2node

CTongue::OnOwnerTakeDamage

0x0083f780 · 1044 bytes · __thiscall

_ZN7CTongue17OnOwnerTakeDamageERK15CTakeDamageInfo

Decompiled

undefined (2 params)

/* CTongue::OnOwnerTakeDamage(CTakeDamageInfo const&) */

void __thiscall CTongue::OnOwnerTakeDamage(CTongue *this,CTakeDamageInfo *param_1)

{
  uint uVar1;
  CTerrorPlayer *this_00;
  code *pcVar2;
  char cVar3;
  uint uVar4;
  int *piVar5;
  undefined4 uVar6;
  int iVar7;
  undefined *puVar8;
  int *piVar9;
  longdouble lVar10;
  char *pcVar11;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  float local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  uVar1 = *(uint *)(this + 0x44c);
  if (uVar1 == 0xffffffff) {
    return;
  }
  puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10;
  if (puVar8 == (undefined *)0xfffffffc) {
    return;
  }
  if (*(uint *)(puVar8 + 8) != uVar1 >> 0xc) {
    return;
  }
  this_00 = *(CTerrorPlayer **)(puVar8 + 4);
  if (this_00 == (CTerrorPlayer *)0x0) {
    return;
  }
  cVar3 = CTerrorGameRules::IsSurvivalMode();
  if (cVar3 != '\0') {
    return;
  }
  uVar1 = *(uint *)(param_1 + 0x48);
  cVar3 = (**(code **)(*(int *)this_00 + 300))(this_00);
  if (cVar3 == '\0') {
    return;
  }
  uVar4 = *(uint *)(this_00 + 0x33c0);
  if (uVar4 == 0xffffffff) {
    return;
  }
  puVar8 = g_pEntityList + (uVar4 & 0xfff) * 0x10;
  if (puVar8 == (undefined *)0xfffffffc) {
    return;
  }
  if (*(uint *)(puVar8 + 8) != uVar4 >> 0xc) {
    return;
  }
  if (*(int *)(puVar8 + 4) == 0) {
    return;
  }
  if ((uVar1 & 8) != 0) {
    return;
  }
  if (*(int *)(this + 0x460) - *(int *)(TongueBreakFromDamageAmount._28_4_ + 0x30) <=
      *(int *)(this_00 + 0x100)) {
    return;
  }
  uVar1 = *(uint *)(param_1 + 0x34);
  if ((((uVar1 != 0xffffffff) &&
       (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) &&
     (piVar9 = *(int **)(puVar8 + 4), piVar9 != (int *)0x0)) {
    cVar3 = (**(code **)(*piVar9 + 0x16c))(piVar9);
    uVar4 = *(uint *)(this_00 + 0x33c0);
    if (cVar3 != '\0') goto LAB_0083f888;
  }
  piVar9 = (int *)0x0;
LAB_0083f888:
  iVar7 = 0;
  if (((uVar4 != 0xffffffff) &&
      (puVar8 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar8 + 8) == uVar4 >> 0xc)) {
    iVar7 = *(int *)(puVar8 + 4);
  }
  if ((&DAT_000033dc)[iVar7] == '\0') {
    pcVar11 = "tongue_pull_stopped";
  }
  else {
    pcVar11 = "choke_stopped";
  }
  piVar5 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,pcVar11,0,0);
  if (piVar5 != (int *)0x0) {
    if (piVar9 != (int *)0x0) {
      pcVar2 = *(code **)(*piVar5 + 0x30);
      uVar6 = (**(code **)(*engine + 0x40))(engine,piVar9[0xc]);
      (*pcVar2)(piVar5,"userid",uVar6);
    }
    iVar7 = 0;
    pcVar2 = *(code **)(*piVar5 + 0x30);
    uVar1 = *(uint *)(this_00 + 0x33c0);
    if (((uVar1 != 0xffffffff) &&
        (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) {
      iVar7 = *(int *)(puVar8 + 4);
    }
    uVar6 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(iVar7 + 0x30));
    (*pcVar2)(piVar5,"victim",uVar6);
    pcVar2 = *(code **)(*piVar5 + 0x30);
    uVar6 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this_00 + 0x30));
    (*pcVar2)(piVar5,"smoker",uVar6);
    (**(code **)(*piVar5 + 0x30))(piVar5,"release_type",3);
    (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar5,0);
  }
  uVar6 = 0;
  uVar1 = *(uint *)(this_00 + 0x33c0);
  if (((uVar1 != 0xffffffff) &&
      (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) {
    uVar6 = *(undefined4 *)(puVar8 + 4);
  }
  (**(code **)(*(int *)this + 0x394))(this,uVar6,"Tongue letting go for taking too much damage.");
  lVar10 = (longdouble)GetAbilityActivationDelay(this);
  CTerrorPlayer::ReleaseTongueVictim(this_00,false);
  CBaseAbility::StartActivationTimer((CBaseAbility *)this,(float)lVar10,0.0);
  cVar3 = CTerrorGameRules::HasPlayerControlledZombies();
  if (cVar3 == '\0') {
    local_7c = *(undefined4 *)param_1;
    local_3c = *(undefined4 *)(param_1 + 0x40);
    local_38 = *(undefined4 *)(param_1 + 0x44);
    local_78 = *(undefined4 *)(param_1 + 4);
    local_74 = *(undefined4 *)(param_1 + 8);
    local_70 = *(undefined4 *)(param_1 + 0xc);
    local_6c = *(undefined4 *)(param_1 + 0x10);
    local_68 = *(undefined4 *)(param_1 + 0x14);
    local_64 = *(undefined4 *)(param_1 + 0x18);
    local_60 = *(undefined4 *)(param_1 + 0x1c);
    local_5c = *(undefined4 *)(param_1 + 0x20);
    local_58 = *(undefined4 *)(param_1 + 0x24);
    local_54 = *(undefined4 *)(param_1 + 0x28);
    local_50 = *(undefined4 *)(param_1 + 0x2c);
    local_4c = *(undefined4 *)(param_1 + 0x30);
    local_48 = *(undefined4 *)(param_1 + 0x34);
    local_44 = *(undefined4 *)(param_1 + 0x38);
    local_34 = *(undefined4 *)(param_1 + 0x48);
    local_24 = *(undefined4 *)(param_1 + 0x58);
    local_30 = *(undefined4 *)(param_1 + 0x4c);
    local_2c = *(undefined4 *)(param_1 + 0x50);
    local_28 = *(undefined4 *)(param_1 + 0x54);
    local_20 = *(undefined4 *)(param_1 + 0x5c);
    local_40 = (float)*(int *)(this_00 + 0x100) + *(float *)(param_1 + 0x3c);
    CBaseEntity::TakeDamage((CBaseEntity *)this_00,(CTakeDamageInfo *)&local_7c);
  }
  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)