L L4D2node

CSecurityFailureAwardTemplate::FireGameEvent

0x0085d470 · 1527 bytes · __thiscall

_ZN29CSecurityFailureAwardTemplate13FireGameEventEP10IGameEvent

Decompiled

undefined (2 params)

/* CSecurityFailureAwardTemplate::FireGameEvent(IGameEvent*) */

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

{
  char cVar1;
  char *pcVar2;
  CBaseEntity *this_00;
  int iVar3;
  CBaseEntity *pCVar4;
  CBaseEntity *this_01;
  int iVar5;
  int *piVar6;
  undefined4 *puVar7;
  int in_GS_OFFSET;
  byte bVar8;
  int local_128;
  int local_124;
  undefined4 local_120;
  undefined4 local_11c [63];
  int local_20;
  
  bVar8 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  pcVar2 = (char *)(**(code **)(*(int *)param_1 + 8))(param_1);
  if (((pcVar2 == (char *)0x0) ||
      (this_00 = (CBaseEntity *)CAwardTemplate::GetOwner((CAwardTemplate *)this),
      this_00 == (CBaseEntity *)0x0)) || (iVar3 = CBaseEntity::GetTeamNumber(this_00), iVar3 != 2))
  goto LAB_0085d4be;
  if ((pcVar2 == "door_open") || (iVar3 = _V_stricmp(pcVar2,"door_open"), iVar3 == 0)) {
    cVar1 = (**(code **)(*(int *)param_1 + 0x18))(param_1,"checkpoint",0);
    if (cVar1 == '\0') goto LAB_0085d4be;
    iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
    pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
    if ((pCVar4 == (CBaseEntity *)0x0) ||
       (cVar1 = (**(code **)(*(int *)param_1 + 0x18))(param_1,"closed",0), cVar1 == '\0'))
    goto LAB_0085d4be;
    if (this_00 == pCVar4) {
      this[0x10] = (CSecurityFailureAwardTemplate)0x1;
    }
    else {
      iVar3 = CBaseEntity::GetTeamNumber(pCVar4);
      if (iVar3 == 2) {
        this[0x10] = (CSecurityFailureAwardTemplate)0x0;
      }
    }
  }
  if ((pcVar2 == "door_unlocked") || (iVar3 = _V_stricmp(pcVar2,"door_unlocked"), iVar3 == 0)) {
    cVar1 = (**(code **)(*(int *)param_1 + 0x18))(param_1,"checkpoint",0);
    if (cVar1 == '\0') goto LAB_0085d4be;
    iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
    pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
    if (pCVar4 == (CBaseEntity *)0x0) goto LAB_0085d4be;
    if (this_00 == pCVar4) goto LAB_0085da28;
    iVar3 = CBaseEntity::GetTeamNumber(pCVar4);
    if (iVar3 != 2) goto LAB_0085d4be;
  }
  else if ((pcVar2 == "player_left_checkpoint") ||
          (iVar3 = _V_stricmp(pcVar2,"player_left_checkpoint"), iVar3 == 0)) {
    iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
    if (iVar3 == 0) {
      iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"entityid",0);
      if (iVar3 == 0) goto LAB_0085d4be;
      iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"entityid",0);
      pCVar4 = (CBaseEntity *)UTIL_EntityByIndex(iVar3);
    }
    else {
      iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
      pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
    }
    if ((pCVar4 == (CBaseEntity *)0x0) ||
       ((cVar1 = (**(code **)(*(int *)pCVar4 + 0x16c))(pCVar4), cVar1 != '\0' &&
        (cVar1 = (**(code **)(*(int *)pCVar4 + 0x7e8))(pCVar4), cVar1 != '\0')))) goto LAB_0085d4be;
    if ((pCVar4 == this_00) && (cVar1 = (**(code **)(*(int *)pCVar4 + 300))(pCVar4), cVar1 != '\0'))
    {
LAB_0085da28:
      this[0x10] = (CSecurityFailureAwardTemplate)0x1;
      goto LAB_0085d4be;
    }
    iVar3 = CBaseEntity::GetTeamNumber(pCVar4);
    if ((iVar3 != 2) || (cVar1 = (**(code **)(*(int *)pCVar4 + 300))(pCVar4), cVar1 == '\0'))
    goto LAB_0085d4be;
  }
  else if ((pcVar2 == "player_entered_checkpoint") ||
          (iVar3 = _V_stricmp(pcVar2,"player_entered_checkpoint"), iVar3 == 0)) {
    iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
    if (iVar3 == 0) {
      iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"entityid",0);
      if (iVar3 == 0) goto LAB_0085d4be;
      iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"entityid",0);
      pCVar4 = (CBaseEntity *)UTIL_EntityByIndex(iVar3);
    }
    else {
      iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
      pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
    }
    this_01 = (CBaseEntity *)(**(code **)(*(int *)pCVar4 + 0x144))(pCVar4);
    if (this_01 == (CBaseEntity *)0x0) goto LAB_0085d4be;
    if (((byte)pCVar4[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(pCVar4);
    }
    iVar3 = TerrorNavMesh::GetCheckpoint(TheNavMesh,(Vector *)(pCVar4 + 0x2e0));
    if (((byte)this_00[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(this_00);
    }
    iVar5 = TerrorNavMesh::GetCheckpoint(TheNavMesh,(Vector *)(this_00 + 0x2e0));
    if (((iVar3 != iVar5) || (iVar3 == 0)) || (*(char *)(iVar3 + 0x5f) == '\0')) goto LAB_0085d4be;
    local_124 = 0;
    local_128 = iVar3;
    ForEachSurvivor<CheckpointSurvivorCount>((CheckpointSurvivorCount *)&local_128);
    if ((local_124 == 0) ||
       ((cVar1 = (**(code **)(*(int *)this_01 + 0x16c))(this_01), cVar1 != '\0' &&
        (cVar1 = (**(code **)(*(int *)this_01 + 0x7e8))(this_01), cVar1 != '\0'))))
    goto LAB_0085d4be;
    if ((this_00 == this_01) &&
       (cVar1 = (**(code **)(*(int *)this_00 + 300))(this_00), cVar1 != '\0')) goto LAB_0085da28;
    iVar3 = CBaseEntity::GetTeamNumber(this_01);
    if ((iVar3 != 2) || (cVar1 = (**(code **)(*(int *)this_01 + 300))(this_01), cVar1 == '\0')) {
      iVar3 = CBaseEntity::GetTeamNumber(this_01);
      if ((iVar3 == 3) &&
         ((cVar1 = (**(code **)(*(int *)this_01 + 300))(this_01), cVar1 != '\0' &&
          (cVar1 = (**(code **)(*(int *)this_01 + 0x558))(this_01), cVar1 == '\0')))) {
        puVar7 = local_11c;
        for (iVar3 = 0x3f; iVar3 != 0; iVar3 = iVar3 + -1) {
          *puVar7 = 0;
          puVar7 = puVar7 + (uint)bVar8 * -2 + 1;
        }
        local_120 = 0;
        piVar6 = (int *)TheLog();
        (**(code **)(*piVar6 + 0x14))(piVar6,this_01,&local_120,0x100);
        if (this[0x10] != (CSecurityFailureAwardTemplate)0x0) {
          (**(code **)(*(int *)this + 0x14))(this,0x5f,0);
        }
      }
      goto LAB_0085d4be;
    }
  }
  else if ((pcVar2 != "map_transition") && (iVar3 = _V_stricmp(pcVar2,"map_transition"), iVar3 != 0)
          ) {
    if (((pcVar2 != "player_first_spawn") &&
        (iVar3 = _V_stricmp(pcVar2,"player_first_spawn"), iVar3 != 0)) ||
       (iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0), iVar3 == 0))
    goto LAB_0085d4be;
    iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
    pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
    if (this_00 != pCVar4) goto LAB_0085d4be;
  }
  this[0x10] = (CSecurityFailureAwardTemplate)0x0;
LAB_0085d4be:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)