L L4D2node

CTerrorPlayer::MakeIncapacitatedEventFromInfo

0x009a75d0 · 959 bytes · __thiscall

_ZN13CTerrorPlayer30MakeIncapacitatedEventFromInfoERK15CTakeDamageInfob

Decompiled

undefined (3 params)

/* CTerrorPlayer::MakeIncapacitatedEventFromInfo(CTakeDamageInfo const&, bool) */

void __thiscall
CTerrorPlayer::MakeIncapacitatedEventFromInfo
          (CTerrorPlayer *this,CTakeDamageInfo *param_1,bool param_2)

{
  CBaseEdict *this_00;
  code *pcVar1;
  int *piVar2;
  CBaseEntity *pCVar3;
  char cVar4;
  int *piVar5;
  int iVar6;
  undefined4 uVar7;
  uint uVar8;
  int iVar9;
  int *piVar10;
  undefined *puVar11;
  uint uVar12;
  byte *__s1;
  byte *pbVar13;
  CBaseEntity *this_01;
  byte *pbVar14;
  bool bVar15;
  bool bVar16;
  byte bVar17;
  CBaseCombatCharacter *local_24;
  
  bVar17 = 0;
  if (param_2) {
    piVar5 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                              (gameeventmanager,"player_incapacitated_start");
    iVar9 = *(int *)(this + 0x3950);
    if (this[0x6c] == (CTerrorPlayer)0x0) {
      this_00 = *(CBaseEdict **)(this + 0x30);
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
        iVar6 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar6 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
    }
    *(int *)(this + 0x3950) = iVar9 + 1;
  }
  else {
    piVar5 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                              (gameeventmanager,"player_incapacitated",0,0);
  }
  if (piVar5 == (int *)0x0) {
    return;
  }
  pcVar1 = *(code **)(*piVar5 + 0x30);
  uVar7 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this + 0x30));
  (*pcVar1)(piVar5,"userid",uVar7);
  uVar8 = *(uint *)(param_1 + 0x34);
  if (uVar8 == 0xffffffff) goto LAB_009a76d0;
  uVar12 = uVar8 & 0xfff;
  piVar10 = (int *)(g_pEntityList + uVar12 * 0x10 + 4);
  if (piVar10 == (int *)0x0) goto LAB_009a76d0;
  if ((*(uint *)(g_pEntityList + uVar12 * 0x10 + 8) == uVar8 >> 0xc) &&
     (piVar2 = *(int **)(g_pEntityList + uVar12 * 0x10 + 4), piVar2 != (int *)0x0)) {
    cVar4 = (**(code **)(*piVar2 + 0x16c))(piVar2);
    if (cVar4 != '\0') {
      uVar8 = *(uint *)(param_1 + 0x34);
      if ((((uVar8 == 0xffffffff) ||
           (puVar11 = g_pEntityList + (uVar8 & 0xfff) * 0x10, puVar11 == (undefined *)0xfffffffc))
          || (*(uint *)(puVar11 + 8) != uVar8 >> 0xc)) ||
         ((local_24 = *(CBaseCombatCharacter **)(puVar11 + 4),
          local_24 == (CBaseCombatCharacter *)0x0 ||
          (cVar4 = (**(code **)(*(int *)local_24 + 0x16c))(local_24), cVar4 == '\0')))) {
        local_24 = (CBaseCombatCharacter *)0x0;
      }
      uVar8 = *(uint *)(param_1 + 0x30);
      bVar15 = uVar8 != 0xffffffff;
      bVar16 = true;
      if (uVar8 == 0xffffffff) {
LAB_009a77df:
        __s1 = &DAT_00d539c2;
LAB_009a77e4:
        iVar9 = 9;
        pbVar13 = __s1;
        pbVar14 = (byte *)0xc103e5;
        do {
          if (iVar9 == 0) break;
          iVar9 = iVar9 + -1;
          bVar15 = *pbVar13 < *pbVar14;
          bVar16 = *pbVar13 == *pbVar14;
          pbVar13 = pbVar13 + (uint)bVar17 * -2 + 1;
          pbVar14 = pbVar14 + (uint)bVar17 * -2 + 1;
        } while (bVar16);
        if (bVar16) {
          __s1 = (byte *)0xc103e5;
        }
        else {
          iVar9 = 9;
          bVar16 = false;
          pbVar13 = __s1;
          pbVar14 = (byte *)0xc6d0dc;
          do {
            if (iVar9 == 0) break;
            iVar9 = iVar9 + -1;
            bVar15 = *pbVar13 < *pbVar14;
            bVar16 = *pbVar13 == *pbVar14;
            pbVar13 = pbVar13 + (uint)bVar17 * -2 + 1;
            pbVar14 = pbVar14 + (uint)bVar17 * -2 + 1;
          } while (bVar16);
          if (bVar16) {
            __s1 = (byte *)0xc6d0dc;
          }
          else {
            iVar9 = 0xc;
            pbVar13 = __s1;
            pbVar14 = (byte *)0xc6d0ed;
            do {
              if (iVar9 == 0) break;
              iVar9 = iVar9 + -1;
              bVar15 = *pbVar13 < *pbVar14;
              bVar16 = *pbVar13 == *pbVar14;
              pbVar13 = pbVar13 + (uint)bVar17 * -2 + 1;
              pbVar14 = pbVar14 + (uint)bVar17 * -2 + 1;
            } while (bVar16);
            if ((!bVar15 && !bVar16) == bVar15) {
              __s1 = (byte *)0xc6d0ed;
            }
          }
        }
      }
      else {
        puVar11 = g_pEntityList + (uVar8 & 0xfff) * 0x10;
        bVar15 = (undefined *)0xfffffffb < puVar11;
        bVar16 = true;
        if (puVar11 == (undefined *)0xfffffffc) goto LAB_009a77df;
        bVar15 = *(uint *)(puVar11 + 8) < uVar8 >> 0xc;
        bVar16 = *(uint *)(puVar11 + 8) == uVar8 >> 0xc;
        if (!bVar16) goto LAB_009a77df;
        pCVar3 = *(CBaseEntity **)(puVar11 + 4);
        bVar15 = false;
        bVar16 = true;
        if (pCVar3 == (CBaseEntity *)0x0) goto LAB_009a77df;
        if (local_24 == (CBaseCombatCharacter *)pCVar3) {
          iVar9 = CBaseCombatCharacter::GetActiveWeapon(local_24);
          bVar15 = false;
          bVar16 = iVar9 == 0;
          if (!bVar16) {
            iVar9 = CBaseCombatCharacter::GetActiveWeapon(local_24);
            __s1 = *(byte **)(iVar9 + 0x7c);
            bVar15 = false;
            if (__s1 != (byte *)0x0) goto LAB_009a7915;
            bVar16 = true;
          }
          goto LAB_009a77df;
        }
        cVar4 = (**(code **)(*(int *)pCVar3 + 0x16c))(pCVar3);
        if (cVar4 != '\0') {
          cVar4 = (**(code **)(*(int *)pCVar3 + 0x16c))(pCVar3);
          this_01 = (CBaseEntity *)0x0;
          if (cVar4 != '\0') {
            this_01 = pCVar3;
          }
          iVar9 = CBaseEntity::GetTeamNumber(this_01);
          if ((iVar9 != 3) || (iVar9 = (**(code **)(*(int *)this_01 + 0x544))(this_01), iVar9 != 2))
          goto LAB_009a790a;
          __s1 = (byte *)0xcd9caf;
          bVar15 = false;
          bVar16 = true;
          goto LAB_009a77e4;
        }
LAB_009a790a:
        __s1 = *(byte **)(pCVar3 + 0x7c);
        bVar15 = false;
        bVar16 = true;
        if (__s1 == (byte *)0x0) goto LAB_009a77df;
LAB_009a7915:
        iVar9 = strncmp((char *)__s1,"weapon_",7);
        bVar15 = false;
        bVar16 = iVar9 == 0;
        if (!bVar16) goto LAB_009a77e4;
        __s1 = __s1 + 7;
      }
      (**(code **)(*piVar5 + 0x3c))(piVar5,"weapon",__s1);
      pcVar1 = *(code **)(*piVar5 + 0x30);
      uVar7 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(local_24 + 0x30));
      (*pcVar1)(piVar5,"attacker",uVar7);
      goto LAB_009a76d0;
    }
    uVar8 = *(uint *)(param_1 + 0x34);
    if ((uVar8 == 0xffffffff) ||
       (piVar10 = (int *)(g_pEntityList + (uVar8 & 0xfff) * 0x10 + 4), piVar10 == (int *)0x0))
    goto LAB_009a76d0;
  }
  if ((piVar10[1] == uVar8 >> 0xc) && (*piVar10 != 0)) {
    iVar9 = *(int *)(*piVar10 + 0x30);
    if (iVar9 == 0) {
      iVar9 = 0;
    }
    else {
      iVar9 = iVar9 - *(int *)(gpGlobals + 0x58) >> 4;
    }
    (**(code **)(*piVar5 + 0x30))(piVar5,"attackerentid",iVar9);
  }
LAB_009a76d0:
  (**(code **)(*piVar5 + 0x30))(piVar5,"type",*(undefined4 *)(param_1 + 0x48));
                    /* WARNING: Could not recover jumptable at 0x009a7708. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  (**(code **)(*gameeventmanager + 0x20))();
  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)