L L4D2node

CGrenadierAwardTemplate::FireGameEvent

0x008530f0 · 1642 bytes · __thiscall

_ZN23CGrenadierAwardTemplate13FireGameEventEP10IGameEvent

Decompiled

undefined (2 params)

/* CGrenadierAwardTemplate::FireGameEvent(IGameEvent*) */

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

{
  char cVar1;
  char *pcVar2;
  CBaseEntity *this_00;
  int iVar3;
  CBaseEntity *pCVar4;
  CBaseEntity *pCVar5;
  int iVar6;
  CBaseCombatCharacter *pCVar7;
  CBaseCombatCharacter *pCVar8;
  
  pcVar2 = (char *)(**(code **)(*(int *)param_1 + 8))(param_1);
  if (pcVar2 == (char *)0x0) {
    return;
  }
  this_00 = (CBaseEntity *)CAwardTemplate::GetOwner((CAwardTemplate *)this);
  if (this_00 == (CBaseEntity *)0x0) {
    return;
  }
  iVar3 = CBaseEntity::GetTeamNumber(this_00);
  if (iVar3 != 2) {
    return;
  }
  if ((pcVar2 == "player_death") || (iVar3 = _V_stricmp(pcVar2,"player_death"), 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) {
        return;
      }
      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);
    }
    iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"attacker",0);
    pCVar5 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
    if (pCVar4 == (CBaseEntity *)0x0) {
      return;
    }
    if (pCVar5 == (CBaseEntity *)0x0) {
      return;
    }
    if (this_00 != pCVar5) {
      return;
    }
    iVar3 = CBaseEntity::GetTeamNumber(this_00);
    iVar6 = CBaseEntity::GetTeamNumber(pCVar4);
    if (iVar3 == iVar6) {
      return;
    }
    pcVar2 = (char *)(**(code **)(*(int *)param_1 + 0x28))(param_1,"weapon",&DAT_00d539c2);
    if (((((pcVar2 != "pipe_bomb") && (iVar3 = _V_stricmp(pcVar2,"pipe_bomb"), iVar3 != 0)) &&
         (pcVar2 != "molotov")) &&
        ((iVar3 = _V_stricmp(pcVar2,"molotov"), iVar3 != 0 && (pcVar2 != "inferno")))) &&
       (iVar3 = _V_stricmp(pcVar2,"inferno"), iVar3 != 0)) {
      return;
    }
    pCVar8 = *(CBaseCombatCharacter **)(this + 0x10);
    *(CBaseCombatCharacter **)(this + 0x10) = pCVar8 + 1;
    if (((int)(pCVar8 + 1) < 10) && (*(char **)(pCVar4 + 0x7c) != "witch")) {
      cVar1 = CBaseEntity::ClassMatchesComplex(pCVar4,"witch");
      goto joined_r0x008533aa;
    }
  }
  else {
    if ((pcVar2 == "player_incapacitated") ||
       (iVar3 = _V_stricmp(pcVar2,"player_incapacitated"), 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) {
          return;
        }
        iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"entityid",0);
        pCVar7 = (CBaseCombatCharacter *)UTIL_EntityByIndex(iVar3);
        pCVar8 = (CBaseCombatCharacter *)0x0;
      }
      else {
        iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
        pCVar7 = (CBaseCombatCharacter *)UTIL_PlayerByUserId(iVar3);
        pCVar8 = pCVar7;
      }
      iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"attacker",0);
      pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
      if (pCVar7 == (CBaseCombatCharacter *)0x0) {
        return;
      }
      if (pCVar4 == (CBaseEntity *)0x0) {
        return;
      }
      if (this_00 != pCVar4) {
        return;
      }
      pcVar2 = (char *)(**(code **)(*(int *)param_1 + 0x28))(param_1,"weapon",&DAT_00d539c2);
      if ((((pcVar2 != "pipe_bomb") && (iVar3 = _V_stricmp(pcVar2,"pipe_bomb"), iVar3 != 0)) &&
          (pcVar2 != "molotov")) &&
         ((iVar3 = _V_stricmp(pcVar2,"molotov"), iVar3 != 0 && (pcVar2 != "inferno")))) {
        iVar3 = _V_stricmp(pcVar2,"inferno");
joined_r0x008534c1:
        if (iVar3 != 0) {
          return;
        }
      }
    }
    else {
      if ((pcVar2 != "player_hurt") && (iVar3 = _V_stricmp(pcVar2,"player_hurt"), iVar3 != 0)) {
        if ((pcVar2 == "weapon_fire") || (iVar3 = _V_stricmp(pcVar2,"weapon_fire"), iVar3 == 0)) {
          iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
          if (iVar3 == 0) {
            return;
          }
          iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
          pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
          if (this_00 != pCVar4) {
            return;
          }
          pcVar2 = (char *)(**(code **)(*(int *)param_1 + 0x28))(param_1,"weapon",&DAT_00d539c2);
          if ((((pcVar2 != "pipe_bomb") && (iVar3 = _V_stricmp(pcVar2,"pipe_bomb"), iVar3 != 0)) &&
              (pcVar2 != "molotov")) &&
             (((iVar3 = _V_stricmp(pcVar2,"molotov"), iVar3 != 0 && (pcVar2 != "inferno")) &&
              (iVar3 = _V_stricmp(pcVar2,"inferno"), iVar3 != 0)))) {
            return;
          }
        }
        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)) {
            return;
          }
          iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
          if (iVar3 == 0) {
            return;
          }
          iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
          pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
          if (this_00 != pCVar4) {
            return;
          }
        }
        goto LAB_00853250;
      }
      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) {
          return;
        }
        iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"entityid",0);
        pCVar7 = (CBaseCombatCharacter *)UTIL_EntityByIndex(iVar3);
        pCVar8 = (CBaseCombatCharacter *)0x0;
      }
      else {
        iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
        pCVar7 = (CBaseCombatCharacter *)UTIL_PlayerByUserId(iVar3);
        pCVar8 = pCVar7;
      }
      iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"attacker",0);
      pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
      if (pCVar7 == (CBaseCombatCharacter *)0x0) {
        return;
      }
      if (pCVar4 == (CBaseEntity *)0x0) {
        return;
      }
      if (this_00 != pCVar4) {
        return;
      }
      pcVar2 = (char *)(**(code **)(*(int *)param_1 + 0x28))(param_1,"weapon",&DAT_00d539c2);
      if (pcVar2 != "pipe_bomb") {
        iVar3 = _V_stricmp(pcVar2,"pipe_bomb");
        goto joined_r0x008534c1;
      }
    }
    if (pCVar8 == (CBaseCombatCharacter *)0x0) {
      return;
    }
    cVar1 = CBaseCombatCharacter::IsA(pCVar8,8);
joined_r0x008533aa:
    if (cVar1 == '\0') {
      return;
    }
  }
  (**(code **)(*(int *)this + 0x14))(this,0xf,0,pCVar8);
LAB_00853250:
  *(undefined4 *)(this + 0x10) = 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)