L L4D2node

CDirectorChallengeMode::OnInfectedKilled

0x00899fb0 · 851 bytes · __thiscall

_ZN22CDirectorChallengeMode16OnInfectedKilledEPK20CBaseCombatCharacterRK15CTakeDamageInfo

Decompiled

undefined (3 params)

/* CDirectorChallengeMode::OnInfectedKilled(CBaseCombatCharacter const*, CTakeDamageInfo const&) */

void __thiscall
CDirectorChallengeMode::OnInfectedKilled
          (CDirectorChallengeMode *this,CBaseCombatCharacter *param_1,CTakeDamageInfo *param_2)

{
  uint uVar1;
  uint uVar2;
  code *pcVar3;
  int *piVar4;
  char *pcVar5;
  int iVar6;
  int *piVar7;
  undefined4 uVar8;
  undefined *puVar9;
  bool bVar10;
  int local_24;
  
  if ((param_1 != (CBaseCombatCharacter *)0x0) && (this[1] != (CDirectorChallengeMode)0x0)) {
    piVar4 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"zombie_death",0,0);
    if (piVar4 != (int *)0x0) {
      uVar1 = *(uint *)(param_2 + 0x48);
      uVar2 = *(uint *)(param_2 + 0x30);
      if (((uVar2 == 0xffffffff) ||
          (puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
         (*(uint *)(puVar9 + 8) != uVar2 >> 0xc)) {
        bVar10 = false;
        local_24 = 0;
      }
      else {
        local_24 = *(int *)(puVar9 + 4);
        if (local_24 == 0) {
          bVar10 = false;
        }
        else {
          pcVar5 = *(char **)(local_24 + 0x7c);
          if (pcVar5 == (char *)0x0) {
            pcVar5 = "";
          }
          iVar6 = _V_stricmp(pcVar5,"prop_minigun");
          if (iVar6 == 0) {
            bVar10 = true;
          }
          else {
            pcVar5 = *(char **)(local_24 + 0x7c);
            if (*(char **)(local_24 + 0x7c) == (char *)0x0) {
              pcVar5 = "";
            }
            iVar6 = _V_stricmp(pcVar5,"prop_minigun_l4d1");
            bVar10 = iVar6 == 0;
          }
        }
      }
      uVar2 = *(uint *)(param_2 + 0x34);
      if (((uVar2 != 0xffffffff) &&
          (puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
         ((*(uint *)(puVar9 + 8) == uVar2 >> 0xc && (*(int *)(puVar9 + 4) != 0)))) {
        iVar6 = *(int *)(*(int *)(puVar9 + 4) + 0x30);
        if (iVar6 == 0) {
          iVar6 = 0;
        }
        else {
          iVar6 = iVar6 - *(int *)(gpGlobals + 0x58) >> 4;
        }
        (**(code **)(*piVar4 + 0x30))(piVar4,"attacker",iVar6);
      }
      uVar2 = *(uint *)(param_2 + 0x38);
      if (((uVar2 == 0xffffffff) ||
          (puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
         ((*(uint *)(puVar9 + 8) != uVar2 >> 0xc ||
          ((piVar7 = *(int **)(puVar9 + 4), piVar7 == (int *)0x0 ||
           (piVar7 = (int *)(**(code **)(*piVar7 + 0x188))(piVar7), piVar7 == (int *)0x0)))))) {
        if (local_24 != 0) {
          pcVar5 = "";
          if (*(char **)(local_24 + 0x7c) != (char *)0x0) {
            pcVar5 = *(char **)(local_24 + 0x7c);
          }
          iVar6 = _V_stricmp(pcVar5,"grenade_launcher_projectile");
          if (iVar6 == 0) {
            (**(code **)(*piVar4 + 0x30))(piVar4,"weapon_id",0x15);
          }
        }
      }
      else {
        pcVar3 = *(code **)(*piVar4 + 0x30);
        uVar8 = (**(code **)(*piVar7 + 0x638))(piVar7);
        (*pcVar3)(piVar4,"weapon_id",uVar8);
      }
      if (*(int *)(param_1 + 0x30) == 0) {
        iVar6 = 0;
      }
      else {
        iVar6 = *(int *)(param_1 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
      }
      (**(code **)(*piVar4 + 0x30))(piVar4,"victim",iVar6);
      pcVar3 = *(code **)(*piVar4 + 0x30);
      uVar8 = CBaseEntity::GetGender((CBaseEntity *)param_1);
      (*pcVar3)(piVar4,"gender",uVar8);
      pcVar3 = *(code **)(*piVar4 + 0x30);
      uVar8 = (**(code **)(*(int *)param_1 + 0x544))(param_1);
      (*pcVar3)(piVar4,"infected_id",uVar8);
      (**(code **)(*piVar4 + 0x2c))(piVar4,"submerged",param_1[0x253] != (CBaseCombatCharacter)0x0);
      (**(code **)(*piVar4 + 0x2c))(piVar4,"headshot",(byte)(uVar1 >> 0x1e) & 1);
      (**(code **)(*piVar4 + 0x2c))(piVar4,"minigun",bVar10);
      (**(code **)(*piVar4 + 0x2c))(piVar4,"blast",(byte)(uVar1 >> 6) & 1);
                    /* WARNING: Could not recover jumptable at 0x0089a274. Too many branches */
                    /* WARNING: Treating indirect jump as call */
      (**(code **)(*gameeventmanager + 0x20))();
      return;
    }
    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)