L L4D2node

CMVPAwardTemplate::FireGameEvent

0x00859d50 · 595 bytes · __thiscall

_ZN17CMVPAwardTemplate13FireGameEventEP10IGameEvent

Decompiled

undefined (2 params)

/* CMVPAwardTemplate::FireGameEvent(IGameEvent*) */

void __thiscall CMVPAwardTemplate::FireGameEvent(CMVPAwardTemplate *this,IGameEvent *param_1)

{
  int iVar1;
  uint uVar2;
  bool bVar3;
  char cVar4;
  char *pcVar5;
  CBaseEntity *this_00;
  int iVar6;
  undefined *puVar7;
  int *piVar8;
  CBaseEntity *this_01;
  int iVar9;
  int iVar10;
  int local_ac;
  int local_a0;
  int local_9c [32];
  int local_1c [3];
  
  pcVar5 = (char *)(**(code **)(*(int *)param_1 + 8))(param_1);
  if ((((pcVar5 != (char *)0x0) &&
       (this_00 = (CBaseEntity *)CAwardTemplate::GetOwner((CAwardTemplate *)this),
       this_00 != (CBaseEntity *)0x0)) && (iVar6 = CBaseEntity::GetTeamNumber(this_00), iVar6 == 2))
     && ((((((pcVar5 != "finale_win" && (iVar6 = _V_stricmp(pcVar5,"finale_win"), iVar6 != 0)) &&
            ((pcVar5 != "mission_lost" && (iVar6 = _V_stricmp(pcVar5,"mission_lost"), iVar6 != 0))))
           && ((pcVar5 == "final_reportscreen" ||
               (iVar6 = _V_stricmp(pcVar5,"final_reportscreen"), iVar6 == 0)))) &&
          (uVar2 = *(uint *)(this_00 + 0x3f34), uVar2 != 0xffffffff)) &&
         ((((puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc &&
            (*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) && (this_00 != *(CBaseEntity **)(puVar7 + 4)))
          && (*(CBaseEntity **)(puVar7 + 4) != (CBaseEntity *)0x0)))))) {
    piVar8 = local_9c;
    do {
      *piVar8 = 0;
      piVar8 = piVar8 + 1;
    } while (piVar8 != local_1c);
    iVar10 = 0;
    bVar3 = false;
    iVar6 = -1;
    local_ac = -1;
    local_a0 = -1;
    do {
      this_01 = (CBaseEntity *)UTIL_PlayerByIndex(iVar10);
      if (((this_01 != (CBaseEntity *)0x0) &&
          (cVar4 = (**(code **)(*(int *)this_01 + 0x16c))(this_01), cVar4 != '\0')) &&
         (iVar9 = CBaseEntity::GetTeamNumber(this_01), iVar9 == 2)) {
        uVar2 = *(uint *)(this_01 + 0x3f34);
        if (((uVar2 != 0xffffffff) &&
            (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
           ((*(uint *)(puVar7 + 8) == uVar2 >> 0xc && (*(int *)(puVar7 + 4) != 0)))) {
          iVar9 = *(int *)(*(int *)(puVar7 + 4) + 0x30);
          if (iVar9 == 0) {
            iVar9 = 0;
          }
          else {
            iVar9 = iVar9 - *(int *)(gpGlobals + 0x58) >> 4;
          }
          iVar1 = local_9c[iVar9] + 1;
          local_9c[iVar9] = iVar1;
          if (local_a0 < iVar1) {
            bVar3 = false;
            local_ac = iVar9;
            local_a0 = iVar1;
          }
          else if (local_a0 == iVar1) {
            bVar3 = true;
          }
        }
        if (this_00 == this_01) {
          iVar6 = iVar10;
        }
      }
      iVar10 = iVar10 + 1;
    } while (iVar10 != 0x20);
    if ((((iVar6 != -1) && (iVar6 == local_ac)) && (1 < local_a0)) && (!bVar3)) {
      (**(code **)(*(int *)this + 0x14))(this,0x1c,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)