L L4D2node

CAbandonmentAwardTemplate::FireGameEvent

0x0084a5c0 · 1708 bytes · __thiscall

_ZN25CAbandonmentAwardTemplate13FireGameEventEP10IGameEvent

Decompiled

undefined (2 params)

/* CAbandonmentAwardTemplate::FireGameEvent(IGameEvent*) */

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

{
  char cVar1;
  bool bVar2;
  char *pcVar3;
  CBaseEntity *this_00;
  int iVar4;
  CBaseEntity *pCVar5;
  int iVar6;
  CNavArea *pCVar7;
  CNavArea *pCVar8;
  uint uVar9;
  int iVar10;
  float fVar11;
  float local_34;
  ShortestPathCost local_25;
  undefined4 local_24;
  undefined4 local_20;
  
  pcVar3 = (char *)(**(code **)(*(int *)param_1 + 8))(param_1);
  if (((pcVar3 != (char *)0x0) &&
      (this_00 = (CBaseEntity *)CAwardTemplate::GetOwner((CAwardTemplate *)this),
      this_00 != (CBaseEntity *)0x0)) && (iVar4 = CBaseEntity::GetTeamNumber(this_00), iVar4 == 2))
  {
    if (((pcVar3 == "player_incapacitated") ||
        (iVar4 = _V_stricmp(pcVar3,"player_incapacitated"), iVar4 == 0)) ||
       ((pcVar3 == "player_ledge_grab" ||
        (iVar4 = _V_stricmp(pcVar3,"player_ledge_grab"), iVar4 == 0)))) {
      iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
      if (iVar4 != 0) {
        iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
        pCVar5 = (CBaseEntity *)UTIL_PlayerByUserId(iVar4);
        if ((this_00 != pCVar5) && (pCVar5 != (CBaseEntity *)0x0)) {
          iVar4 = CBaseEntity::GetTeamNumber(pCVar5);
          iVar6 = CBaseEntity::GetTeamNumber(this_00);
          if (iVar4 == iVar6) {
            if (((byte)pCVar5[0x14d] & 8) != 0) {
              CBaseEntity::CalcAbsolutePosition(pCVar5);
            }
            pCVar7 = (CNavArea *)
                     CNavMesh::GetNearestNavArea
                               (TheNavMesh,(Vector *)(pCVar5 + 0x2e0),false,10000.0,false,true,false
                               );
            pCVar8 = (CNavArea *)(**(code **)(*(int *)this_00 + 0x52c))(this_00);
            if ((((pCVar8 != (CNavArea *)0x0) && (pCVar7 != (CNavArea *)0x0)) &&
                (*(float *)(pCVar7 + 0x154) != -1.0)) &&
               ((*(float *)(pCVar8 + 0x154) != -1.0 &&
                (bVar2 = NavAreaBuildPath<ShortestPathCost>
                                   (pCVar8,pCVar7,(Vector *)0x0,(Vector *)0x0,&local_25,
                                    (CNavArea **)0x0,0.0,-1,false), bVar2)))) {
              local_24 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(pCVar5 + 0x30));
              local_20 = *(undefined4 *)(gpGlobals + 0xc);
              CUtlLinkedList<CAbandonmentAwardTemplate::RegretStruct,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CAbandonmentAwardTemplate::RegretStruct,unsigned_short>,unsigned_short>>
              ::InsertBefore((CUtlLinkedList<CAbandonmentAwardTemplate::RegretStruct,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CAbandonmentAwardTemplate::RegretStruct,unsigned_short>,unsigned_short>>
                              *)(this + 0x10),0xffff,(RegretStruct *)&local_24);
            }
          }
        }
      }
    }
    else if ((pcVar3 == "revive_success") ||
            (iVar4 = _V_stricmp(pcVar3,"revive_success"), iVar4 == 0)) {
      iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"subject",0);
      if (iVar4 != 0) {
        iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"subject",0);
        pCVar5 = (CBaseEntity *)UTIL_PlayerByUserId(iVar4);
        if ((this_00 != pCVar5) && (pCVar5 != (CBaseEntity *)0x0)) {
          iVar4 = CBaseEntity::GetTeamNumber(pCVar5);
          iVar6 = CBaseEntity::GetTeamNumber(this_00);
          if ((iVar4 == iVar6) && (uVar9 = (uint)*(ushort *)(this + 0x1c), uVar9 != 0xffff)) {
            iVar4 = *(int *)(this + 0x10);
            do {
              iVar4 = *(int *)(iVar4 + uVar9 * 0xc);
              iVar6 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(pCVar5 + 0x30));
              if (iVar4 == iVar6) {
                CUtlLinkedList<CAbandonmentAwardTemplate::RegretStruct,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CAbandonmentAwardTemplate::RegretStruct,unsigned_short>,unsigned_short>>
                ::Unlink((CUtlLinkedList<CAbandonmentAwardTemplate::RegretStruct,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CAbandonmentAwardTemplate::RegretStruct,unsigned_short>,unsigned_short>>
                          *)(this + 0x10),(ushort)uVar9);
                *(undefined2 *)(*(int *)(this + 0x10) + 10 + uVar9 * 0xc) =
                     *(undefined2 *)(this + 0x20);
                *(ushort *)(this + 0x20) = (ushort)uVar9;
                return;
              }
              iVar4 = *(int *)(this + 0x10);
              uVar9 = (uint)*(ushort *)(iVar4 + 10 + uVar9 * 0xc);
            } while (uVar9 != 0xffff);
          }
        }
      }
    }
    else if ((pcVar3 == "player_death") || (iVar4 = _V_stricmp(pcVar3,"player_death"), iVar4 == 0))
    {
      iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
      if (iVar4 != 0) {
        iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
        pCVar5 = (CBaseEntity *)UTIL_PlayerByUserId(iVar4);
        if ((this_00 != pCVar5) && (pCVar5 != (CBaseEntity *)0x0)) {
          iVar4 = CBaseEntity::GetTeamNumber(pCVar5);
          iVar6 = CBaseEntity::GetTeamNumber(this_00);
          if ((iVar4 == iVar6) && (iVar4 = CBaseEntity::GetTeamNumber(pCVar5), iVar4 == 2)) {
            uVar9 = (uint)*(ushort *)(this + 0x1c);
            if (uVar9 == 0xffff) {
              bVar2 = false;
              local_34 = 0.0;
            }
            else {
              iVar4 = *(int *)(this + 0x10);
              do {
                iVar10 = uVar9 * 0xc;
                iVar6 = *(int *)(iVar4 + iVar10);
                local_34 = (float)((int *)(iVar4 + iVar10))[1];
                iVar4 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(pCVar5 + 0x30));
                if (iVar6 == iVar4) {
                  CUtlLinkedList<CAbandonmentAwardTemplate::RegretStruct,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CAbandonmentAwardTemplate::RegretStruct,unsigned_short>,unsigned_short>>
                  ::Unlink((CUtlLinkedList<CAbandonmentAwardTemplate::RegretStruct,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CAbandonmentAwardTemplate::RegretStruct,unsigned_short>,unsigned_short>>
                            *)(this + 0x10),(ushort)uVar9);
                  *(undefined2 *)(*(int *)(this + 0x10) + 10 + iVar10) =
                       *(undefined2 *)(this + 0x20);
                  *(ushort *)(this + 0x20) = (ushort)uVar9;
                  bVar2 = true;
                  goto LAB_0084aae7;
                }
                iVar4 = *(int *)(this + 0x10);
                uVar9 = (uint)*(ushort *)(iVar4 + 10 + iVar10);
              } while (uVar9 != 0xffff);
              bVar2 = false;
            }
LAB_0084aae7:
            cVar1 = (**(code **)(*(int *)this_00 + 0x7e8))(this_00);
            if ((((cVar1 == '\0') &&
                 (cVar1 = (**(code **)(*(int *)this_00 + 300))(this_00), cVar1 != '\0')) && (bVar2))
               && (5.0 <= *(float *)(gpGlobals + 0xc) - local_34)) {
              if (((byte)pCVar5[0x14d] & 8) != 0) {
                CBaseEntity::CalcAbsolutePosition(pCVar5);
              }
              pCVar7 = (CNavArea *)
                       CNavMesh::GetNearestNavArea
                                 (TheNavMesh,(Vector *)(pCVar5 + 0x2e0),false,10000.0,false,true,
                                  false);
              pCVar8 = (CNavArea *)(**(code **)(*(int *)this_00 + 0x52c))(this_00);
              if ((pCVar7 == (CNavArea *)0x0) || (pCVar8 == (CNavArea *)0x0)) {
                fVar11 = 0.0;
              }
              else {
                fVar11 = ABS(*(float *)(pCVar7 + 0x154) - *(float *)(pCVar8 + 0x154));
              }
              if (((pCVar8 == (CNavArea *)0x0) || (pCVar7 == (CNavArea *)0x0)) ||
                 ((bVar2 = NavAreaBuildPath<ShortestPathCost>
                                     (pCVar8,pCVar7,(Vector *)0x0,(Vector *)0x0,
                                      (ShortestPathCost *)&local_24,(CNavArea **)0x0,0.0,-1,false),
                  !bVar2 || ((1000.0 < fVar11 || (((byte)pCVar8[0x12d] & 8) != 0)))))) {
                (**(code **)(*(int *)this + 0x14))(this,0x56,0);
              }
            }
          }
        }
      }
    }
    else {
      if ((pcVar3 == "map_transition") || (iVar4 = _V_stricmp(pcVar3,"map_transition"), iVar4 == 0))
      {
LAB_0084a720:
        CUtlLinkedList<CAbandonmentAwardTemplate::RegretStruct,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CAbandonmentAwardTemplate::RegretStruct,unsigned_short>,unsigned_short>>
        ::RemoveAll((CUtlLinkedList<CAbandonmentAwardTemplate::RegretStruct,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CAbandonmentAwardTemplate::RegretStruct,unsigned_short>,unsigned_short>>
                     *)(this + 0x10));
        return;
      }
      if (((pcVar3 == "player_first_spawn") ||
          (iVar4 = _V_stricmp(pcVar3,"player_first_spawn"), iVar4 == 0)) &&
         (iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0), iVar4 != 0)) {
        iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
        pCVar5 = (CBaseEntity *)UTIL_PlayerByUserId(iVar4);
        if (this_00 == pCVar5) goto LAB_0084a720;
      }
    }
  }
  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)