L L4D2node

CGoodTeammateAwardTemplate::FireGameEvent

0x00851320 · 722 bytes · __thiscall

_ZN26CGoodTeammateAwardTemplate13FireGameEventEP10IGameEvent

Decompiled

undefined (2 params)

/* CGoodTeammateAwardTemplate::FireGameEvent(IGameEvent*) */

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

{
  char cVar1;
  char *pcVar2;
  CBaseEntity *this_00;
  int iVar3;
  int *piVar4;
  undefined4 uVar5;
  int iVar6;
  CBaseEntity *pCVar7;
  
  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))
  {
    return;
  }
  if ((pcVar2 == "map_transition") || (iVar3 = _V_stricmp(pcVar2,"map_transition"), iVar3 == 0)) {
    cVar1 = CTerrorPlayer::WasSpawnedAtCheckpoint((CTerrorPlayer *)this_00);
    if ((cVar1 != '\0') && (this[0x10] == (CGoodTeammateAwardTemplate)0x0)) {
      (**(code **)(*(int *)this + 0x14))(this,0x4a,0);
    }
    this[0x10] = (CGoodTeammateAwardTemplate)0x0;
    return;
  }
  if ((pcVar2 == "player_first_spawn") ||
     (iVar3 = _V_stricmp(pcVar2,"player_first_spawn"), 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);
    pCVar7 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
    if (this_00 != pCVar7) {
      return;
    }
    this[0x10] = (CGoodTeammateAwardTemplate)0x0;
    this[0x11] = (CGoodTeammateAwardTemplate)0x0;
    this[0x12] = (CGoodTeammateAwardTemplate)0x0;
    return;
  }
  if ((pcVar2 == "award_earned") || (iVar3 = _V_stricmp(pcVar2,"award_earned"), iVar3 == 0)) {
    iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
    if (iVar3 == 0) {
      pCVar7 = (CBaseEntity *)0x0;
      uVar5 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"award",0);
    }
    else {
      iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
      pCVar7 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
      uVar5 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"award",0);
      if (this_00 == pCVar7) {
        iVar3 = TerrorAward::GetCategoryFromType(uVar5);
        if (iVar3 != 2) {
          return;
        }
        this[0x10] = (CGoodTeammateAwardTemplate)0x1;
        this[0x11] = (CGoodTeammateAwardTemplate)0x1;
        return;
      }
    }
    iVar3 = CBaseEntity::GetTeamNumber(this_00);
    iVar6 = CBaseEntity::GetTeamNumber(pCVar7);
    if (iVar3 != iVar6) {
      return;
    }
    iVar3 = TerrorAward::GetCategoryFromType(uVar5);
    if (iVar3 != 2) {
      return;
    }
    this[0x12] = (CGoodTeammateAwardTemplate)0x1;
    return;
  }
  if ((pcVar2 != "finale_win") && (iVar3 = _V_stricmp(pcVar2,"finale_win"), iVar3 != 0)) {
    return;
  }
  cVar1 = (**(code **)(*(int *)this_00 + 300))(this_00);
  if (cVar1 == '\0') {
    return;
  }
  if (this[0x11] != (CGoodTeammateAwardTemplate)0x0) {
    return;
  }
  (**(code **)(*(int *)this + 0x14))(this,0x1d,0);
  if (this[0x12] != (CGoodTeammateAwardTemplate)0x0) {
    return;
  }
  iVar3 = GetGlobalTeam(2);
  if (iVar3 != 0) {
    piVar4 = (int *)GetGlobalTeam(2);
    iVar3 = (**(code **)(*piVar4 + 0x354))(piVar4);
    if (iVar3 == 1) {
      return;
    }
  }
  (**(code **)(*(int *)this + 0x14))(this,0x52,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)