L L4D2node

CAchievementMgr::OnKillEvent

0x003e9190 · 492 bytes · __thiscall

_ZN15CAchievementMgr11OnKillEventEP11CBaseEntityS1_S1_P10IGameEvent

Decompiled

undefined (5 params)

/* CAchievementMgr::OnKillEvent(CBaseEntity*, CBaseEntity*, CBaseEntity*, IGameEvent*) */

void __thiscall
CAchievementMgr::OnKillEvent
          (CAchievementMgr *this,CBaseEntity *param_1,CBaseEntity *param_2,CBaseEntity *param_3,
          IGameEvent *param_4)

{
  char *pcVar1;
  bool bVar2;
  char cVar3;
  uint uVar4;
  CBaseEntity *pCVar5;
  int *piVar6;
  CAchievementMgr *pCVar7;
  int iVar8;
  bool bVar9;
  int local_24;
  
  if (param_1 != (CBaseEntity *)0x0) {
    cVar3 = (**(code **)(*g_pGameRules + 0x88))(g_pGameRules);
    if ((cVar3 == '\0') &&
       (pCVar5 = (CBaseEntity *)UTIL_GetLocalPlayer(), pCVar5 != (CBaseEntity *)0x0)) {
      bVar9 = pCVar5 == param_2;
      piVar6 = (int *)__dynamic_cast(param_1,&CBaseEntity::typeinfo,&CBaseCombatCharacter::typeinfo,
                                     0);
      if ((piVar6 == (int *)0x0) ||
         (iVar8 = (**(code **)(*piVar6 + 0x4f4))(piVar6,pCVar5), iVar8 != 1)) {
        bVar2 = false;
      }
      else {
        bVar2 = true;
      }
    }
    else {
      bVar2 = false;
      bVar9 = false;
    }
    local_24 = 2;
    pCVar7 = this + 0xc0;
    do {
      if (0 < *(int *)(pCVar7 + 0xc)) {
        iVar8 = 0;
        do {
          piVar6 = *(int **)(*(int *)pCVar7 + iVar8 * 4);
          cVar3 = (**(code **)(*piVar6 + 0x54))(piVar6);
          if ((((((cVar3 != '\0') &&
                 ((uVar4 = (**(code **)(*piVar6 + 0x24))(piVar6), (uVar4 & 0x100) == 0 || (bVar9))))
                && ((uVar4 = (**(code **)(*piVar6 + 0x24))(piVar6), (uVar4 & 0x200) == 0 || (bVar2))
                   )) && (((pcVar1 = (char *)piVar6[0xe], pcVar1 == (char *)0x0 ||
                           (pcVar1 == *(char **)(param_1 + 0x7c))) ||
                          (cVar3 = CBaseEntity::ClassMatchesComplex(param_1,pcVar1), cVar3 != '\0'))
                         )) &&
              ((pcVar1 = (char *)piVar6[0xc], pcVar1 == (char *)0x0 ||
               ((param_3 != (CBaseEntity *)0x0 &&
                ((pcVar1 == *(char **)(param_3 + 0x7c) ||
                 (cVar3 = CBaseEntity::ClassMatchesComplex(param_3,pcVar1), cVar3 != '\0')))))))) &&
             (((pcVar1 = (char *)piVar6[0xf], pcVar1 == (char *)0x0 ||
               ((param_2 != (CBaseEntity *)0x0 &&
                ((pcVar1 == *(char **)(param_2 + 0x7c) ||
                 (cVar3 = CBaseEntity::ClassMatchesComplex(param_2,pcVar1), cVar3 != '\0')))))) &&
              ((pcVar1 = (char *)piVar6[0xd], pcVar1 == (char *)0x0 ||
               ((param_3 != (CBaseEntity *)0x0 &&
                ((pcVar1 == *(char **)(param_3 + 0x154) ||
                 (cVar3 = CBaseEntity::NameMatchesComplex(param_3,pcVar1), cVar3 != '\0')))))))))) {
            (**(code **)(*piVar6 + 0x18))(piVar6,param_1,param_2,param_3,param_4);
          }
          iVar8 = iVar8 + 1;
        } while (iVar8 < *(int *)(pCVar7 + 0xc));
      }
      pCVar7 = pCVar7 + 0x14;
      local_24 = local_24 + -1;
    } while (local_24 != 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)