L L4D2node

CTongue::OnTongueShot

0x0083ef50 · 1205 bytes · __thiscall

_ZN7CTongue12OnTongueShotEP13CTerrorPlayerfjRK6VectorS4_

Decompiled

undefined (6 params)

/* CTongue::OnTongueShot(CTerrorPlayer*, float, unsigned int, Vector const&, Vector const&) */

void __thiscall
CTongue::OnTongueShot
          (CTongue *this,CTerrorPlayer *param_1,float param_2,uint param_3,Vector *param_4,
          Vector *param_5)

{
  float fVar1;
  uint uVar2;
  CTerrorPlayer *this_00;
  code *pcVar3;
  int *piVar4;
  undefined4 uVar5;
  int iVar6;
  undefined *puVar7;
  longdouble lVar8;
  char *pcVar9;
  int local_30;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  uVar2 = *(uint *)(this + 0x44c);
  if ((((uVar2 == 0xffffffff) ||
       (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar7 + 8) != uVar2 >> 0xc)) ||
     (((this_00 = *(CTerrorPlayer **)(puVar7 + 4), this_00 == (CTerrorPlayer *)0x0 ||
       (uVar2 = *(uint *)(this_00 + 0x33c0), uVar2 == 0xffffffff)) ||
      ((puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc ||
       ((*(uint *)(puVar7 + 8) != uVar2 >> 0xc || (*(int *)(puVar7 + 4) == 0)))))))) {
    return;
  }
  (**(code **)(*(int *)this + 0x394))
            (this,*(int *)(puVar7 + 4),"Tongue took %f damage (was %f/%f).",(double)param_2,
             (double)*(float *)(this + 0x568),(double)*(float *)(TongueHealth._28_4_ + 0x2c));
  for (iVar6 = IPredictionSystem::g_pPredictionSystems; iVar6 != 0; iVar6 = *(int *)(iVar6 + 4)) {
    *(int *)(iVar6 + 0x10) = *(int *)(iVar6 + 0x10) + 1;
  }
                    /* try { // try from 0083f038 to 0083f089 has its CatchHandler @ 0083f412 */
  VectorAngles(param_5,(QAngle *)&local_28);
  DispatchParticleEffect
            ("blood_impact_smoker_01",*(undefined4 *)param_4,*(undefined4 *)(param_4 + 4),
             *(undefined4 *)(param_4 + 8),local_28,local_24,local_20,0,0,0xffffffff);
  for (iVar6 = IPredictionSystem::g_pPredictionSystems; iVar6 != 0; iVar6 = *(int *)(iVar6 + 4)) {
    *(int *)(iVar6 + 0x10) = *(int *)(iVar6 + 0x10) + -1;
  }
  fVar1 = *(float *)(this + 0x568);
  *(float *)(this + 0x568) = fVar1 - param_2;
  if (0.0 < fVar1 - param_2) {
    return;
  }
  uVar2 = *(uint *)(this_00 + 0x33c0);
  iVar6 = 0;
  if (((uVar2 != 0xffffffff) &&
      (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) {
    iVar6 = *(int *)(puVar7 + 4);
  }
  if ((&DAT_000033dc)[iVar6] == '\0') {
    piVar4 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                              (gameeventmanager,"tongue_pull_stopped",0,0);
    if (piVar4 == (int *)0x0) goto LAB_0083f23a;
    if (param_1 != (CTerrorPlayer *)0x0) {
      pcVar3 = *(code **)(*piVar4 + 0x30);
      uVar5 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(param_1 + 0x30));
      (*pcVar3)(piVar4,"userid",uVar5);
    }
    local_30 = 0;
    pcVar3 = *(code **)(*piVar4 + 0x30);
    uVar2 = *(uint *)(this_00 + 0x33c0);
    if (((uVar2 != 0xffffffff) &&
        (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) {
      local_30 = *(int *)(puVar7 + 4);
    }
    uVar5 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(local_30 + 0x30));
    (*pcVar3)(piVar4,"victim",uVar5);
    pcVar3 = *(code **)(*piVar4 + 0x30);
    uVar5 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this_00 + 0x30));
    (*pcVar3)(piVar4,"smoker",uVar5);
    (**(code **)(*piVar4 + 0x30))(piVar4,"release_type",4);
    iVar6 = *piVar4;
    pcVar9 = "damage_type";
  }
  else {
    piVar4 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"choke_stopped");
    if (piVar4 == (int *)0x0) goto LAB_0083f23a;
    if (param_1 != (CTerrorPlayer *)0x0) {
      pcVar3 = *(code **)(*piVar4 + 0x30);
      uVar5 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(param_1 + 0x30));
      (*pcVar3)(piVar4,"userid",uVar5);
    }
    local_30 = 0;
    pcVar3 = *(code **)(*piVar4 + 0x30);
    uVar2 = *(uint *)(this_00 + 0x33c0);
    if (((uVar2 != 0xffffffff) &&
        (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) {
      local_30 = *(int *)(puVar7 + 4);
    }
    uVar5 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(local_30 + 0x30));
    (*pcVar3)(piVar4,"victim",uVar5);
    pcVar3 = *(code **)(*piVar4 + 0x30);
    uVar5 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this_00 + 0x30));
    (*pcVar3)(piVar4,"smoker",uVar5);
    iVar6 = *piVar4;
    param_3 = 4;
    pcVar9 = "release_type";
  }
  (**(code **)(iVar6 + 0x30))(piVar4,pcVar9,param_3);
  (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar4,0);
LAB_0083f23a:
  uVar5 = 0;
  uVar2 = *(uint *)(this_00 + 0x33c0);
  if (((uVar2 != 0xffffffff) &&
      (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) {
    uVar5 = *(undefined4 *)(puVar7 + 4);
  }
  (**(code **)(*(int *)this + 0x394))(this,uVar5,"Tongue letting go because of damage.");
  lVar8 = (longdouble)GetAbilityActivationDelay(this);
  CTerrorPlayer::ReleaseTongueVictim(this_00,false);
  CBaseAbility::StartActivationTimer((CBaseAbility *)this,(float)lVar8,0.0);
  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)