L L4D2node

CGotchaAwardTemplate::FireGameEvent

0x00851830 · 469 bytes · __thiscall

_ZN20CGotchaAwardTemplate13FireGameEventEP10IGameEvent

Decompiled

undefined (2 params)

/* CGotchaAwardTemplate::FireGameEvent(IGameEvent*) */

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

{
  code *pcVar1;
  char *pcVar2;
  CBaseEntity *pCVar3;
  int iVar4;
  CBaseEntity *this_00;
  CBaseEntity *this_01;
  int iVar5;
  undefined4 uVar6;
  undefined **local_24;
  int local_20;
  
  pcVar2 = (char *)(**(code **)(*(int *)param_1 + 8))(param_1);
  if (((pcVar2 != (char *)0x0) &&
      (pCVar3 = (CBaseEntity *)CAwardTemplate::GetOwner((CAwardTemplate *)this),
      pCVar3 != (CBaseEntity *)0x0)) &&
     ((pcVar2 == "player_hurt" ||
      (((iVar4 = _V_stricmp(pcVar2,"player_hurt"), iVar4 == 0 || (pcVar2 == "player_incapacitated"))
       || (iVar4 = _V_stricmp(pcVar2,"player_incapacitated"), iVar4 == 0)))))) {
    iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
    this_00 = (CBaseEntity *)UTIL_PlayerByUserId(iVar4);
    iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"attacker",0);
    this_01 = (CBaseEntity *)UTIL_PlayerByUserId(iVar4);
    if (((this_00 != (CBaseEntity *)0x0) && (this_01 != (CBaseEntity *)0x0)) &&
       ((iVar4 = CBaseEntity::GetTeamNumber(this_01), iVar4 == 3 &&
        (iVar4 = CBaseEntity::GetTeamNumber(this_00), iVar4 == 2)))) {
      iVar4 = (**(code **)(*(int *)this_00 + 0x52c))(this_00);
      iVar5 = (**(code **)(*(int *)this_01 + 0x52c))(this_01);
      if (((iVar4 != 0) && ((*(byte *)(iVar4 + 0x12d) & 8) != 0)) &&
         ((iVar5 != 0 && ((*(byte *)(iVar5 + 0x12d) & 8) == 0)))) {
        local_24 = &PTR_EnumElement_00cd8b50;
        local_20 = 0;
        pcVar1 = *(code **)(*partition + 0x3c);
        uVar6 = (**(code **)(*(int *)this_00 + 0x288))(this_00);
        (*pcVar1)(partition,1,uVar6,0x42c80000,1,&local_24);
        if ((local_20 != 0) && (*(int *)(&DAT_000015f4 + local_20) == 0)) {
          if (pCVar3 == this_00) {
            (**(code **)(*(int *)this + 0x14))(this,0x65,0);
          }
          else if (pCVar3 == this_01) {
            (**(code **)(*(int *)this + 0x14))(this,0x94,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)