L L4D2node

CKnockdownAwardTemplate::FireGameEvent

0x00858780 · 1034 bytes · __thiscall

_ZN23CKnockdownAwardTemplate13FireGameEventEP10IGameEvent

Decompiled

undefined (2 params)

/* CKnockdownAwardTemplate::FireGameEvent(IGameEvent*) */

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

{
  float fVar1;
  char *pcVar2;
  CBaseEntity *this_00;
  int iVar3;
  CBaseEntity *pCVar4;
  CBaseEntity *pCVar5;
  int iVar6;
  CKnockdownAwardTemplate *pCVar7;
  longdouble lVar8;
  
  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))
  {
    if ((pcVar2 == "player_incapacitated") ||
       (iVar3 = _V_stricmp(pcVar2,"player_incapacitated"), iVar3 == 0)) {
      iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
      pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
      iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"attacker",0);
      pCVar5 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
      if ((pCVar4 != (CBaseEntity *)0x0) && ((pCVar5 != (CBaseEntity *)0x0 && (this_00 != pCVar4))))
      {
        iVar3 = CBaseEntity::GetTeamNumber(pCVar4);
        iVar6 = CBaseEntity::GetTeamNumber(this_00);
        if (iVar3 == iVar6) {
          iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"type",0);
          iVar6 = CTerrorPlayer::GetOtherResponsibleForMovement((CTerrorPlayer *)pCVar4);
          if ((iVar6 == 0) && (iVar3 != 0x808)) {
            if (this_00 != pCVar5) {
              if (*(int *)(pCVar4 + 0x30) == 0) {
                if (*(float *)(this + 0x14) <= 0.0) {
                  return;
                }
                fVar1 = *(float *)(this + 0x14);
                pCVar7 = this + 0x10;
              }
              else {
                pCVar7 = this + (*(int *)(pCVar4 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4) * 8 +
                                0x10;
                fVar1 = *(float *)(pCVar7 + 4);
              }
              if (fVar1 <= 0.0) {
                return;
              }
              lVar8 = (longdouble)IntervalTimer::Now();
              if (0.5 <= (float)lVar8 - *(float *)(pCVar7 + 4)) {
                return;
              }
            }
            (**(code **)(*(int *)this + 0x14))(this,0x55,0);
          }
        }
      }
    }
    else if ((pcVar2 == "player_hurt") || (iVar3 = _V_stricmp(pcVar2,"player_hurt"), iVar3 == 0)) {
      iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
      pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
      iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"attacker",0);
      pCVar5 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
      if ((pCVar4 != (CBaseEntity *)0x0) &&
         (((pCVar5 != (CBaseEntity *)0x0 && (this_00 != pCVar4)) && (this_00 == pCVar5)))) {
        iVar3 = CBaseEntity::GetTeamNumber(pCVar4);
        iVar6 = CBaseEntity::GetTeamNumber(pCVar5);
        if (iVar3 == iVar6) {
          if (*(int *)(pCVar4 + 0x30) == 0) {
            iVar3 = 0;
          }
          else {
            iVar3 = *(int *)(pCVar4 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
          }
          pCVar7 = this + iVar3 * 8 + 0x10;
          lVar8 = (longdouble)IntervalTimer::Now();
          if ((float)lVar8 != *(float *)(pCVar7 + 4)) {
            (**(code **)(*(int *)pCVar7 + 4))(pCVar7,pCVar7 + 4);
            *(float *)(pCVar7 + 4) = (float)lVar8;
          }
        }
      }
    }
    else if ((pcVar2 == "map_transition") ||
            (iVar3 = _V_stricmp(pcVar2,"map_transition"), iVar3 == 0)) {
      iVar3 = 0;
      pCVar7 = this + 0x10;
      do {
        if (*(float *)(this + (int)(pCVar7 + (4 - (int)this))) != -1.0) {
          (**(code **)(*(int *)pCVar7 + 4))(pCVar7,pCVar7 + 4);
          *(undefined4 *)(this + (int)(pCVar7 + (4 - (int)this))) = 0xbf800000;
        }
        iVar3 = iVar3 + 1;
        pCVar7 = pCVar7 + 8;
      } while (iVar3 != 0x20);
    }
    else 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)) {
      iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
      pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
      if (this_00 == pCVar4) {
        iVar3 = 0;
        pCVar7 = this + 0x10;
        do {
          if (*(float *)(this + (int)(pCVar7 + (4 - (int)this))) != -1.0) {
            (**(code **)(*(int *)pCVar7 + 4))(pCVar7,pCVar7 + 4);
            *(undefined4 *)(this + (int)(pCVar7 + (4 - (int)this))) = 0xbf800000;
          }
          iVar3 = iVar3 + 1;
          pCVar7 = pCVar7 + 8;
        } while (iVar3 != 0x20);
      }
    }
  }
  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)