L L4D2node

CTongueChokeAwardTemplate::FireGameEvent

0x0085fc90 · 1074 bytes · __thiscall

_ZN25CTongueChokeAwardTemplate13FireGameEventEP10IGameEvent

Decompiled

undefined (2 params)

/* CTongueChokeAwardTemplate::FireGameEvent(IGameEvent*) */

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

{
  uint uVar1;
  char *pcVar2;
  CBaseEntity *this_00;
  int iVar3;
  CBaseEntity *pCVar4;
  int iVar5;
  CBaseEntity *pCVar6;
  undefined *puVar7;
  
  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 == 3))
     && ((iVar3 = CBaseEntity::GetTeamNumber(this_00), iVar3 == 3 &&
         (iVar3 = (**(code **)(*(int *)this_00 + 0x544))(this_00), iVar3 == 1)))) {
    if ((pcVar2 == "player_hurt") || (iVar3 = _V_stricmp(pcVar2,"player_hurt"), iVar3 == 0)) {
      iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"attacker",0);
      pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
      iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
      iVar3 = UTIL_PlayerByUserId(iVar3);
      if ((((iVar3 != 0) && (this_00 == pCVar4)) &&
          (uVar1 = *(uint *)(iVar3 + 0x33c4), uVar1 != 0xffffffff)) &&
         ((((puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc &&
            (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) && (this_00 == *(CBaseEntity **)(puVar7 + 4)))
          && ((iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"type",0), iVar3 == 0x100000 &&
              (this[0x10] == (CTongueChokeAwardTemplate)0x0)))))) {
        this[0x10] = (CTongueChokeAwardTemplate)0x1;
        iVar3 = *(int *)(this + 0x14);
        iVar5 = iVar3 + 1;
        *(int *)(this + 0x14) = iVar5;
        if (iVar5 == 1) {
          (**(code **)(*(int *)this + 0x14))(this,0x6d,0,iVar3);
        }
        else if (iVar5 == 2) {
          (**(code **)(*(int *)this + 0x14))(this,0x6e,0);
        }
        else if (iVar5 == 3) {
          (**(code **)(*(int *)this + 0x14))(this,0x6f,0);
        }
        else if (iVar5 == 4) {
          (**(code **)(*(int *)this + 0x14))(this,0x70,0);
        }
        else if (iVar5 == 5) {
          (**(code **)(*(int *)this + 0x14))(this,0x71,0);
        }
      }
    }
    else {
      if ((pcVar2 == "player_incapacitated") ||
         (iVar3 = _V_stricmp(pcVar2,"player_incapacitated"), iVar3 == 0)) {
        iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"attacker",0);
        pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
        iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
        iVar3 = UTIL_PlayerByUserId(iVar3);
        if (iVar3 == 0) {
          return;
        }
        if (this_00 != pCVar4) {
          return;
        }
        uVar1 = *(uint *)(iVar3 + 0x33c4);
        if (uVar1 == 0xffffffff) {
          return;
        }
        puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10;
        if (puVar7 == (undefined *)0xfffffffc) {
          return;
        }
        if (*(uint *)(puVar7 + 8) != uVar1 >> 0xc) {
          return;
        }
        if (this_00 != *(CBaseEntity **)(puVar7 + 4)) {
          return;
        }
      }
      else {
        if ((pcVar2 != "player_death") && (iVar3 = _V_stricmp(pcVar2,"player_death"), iVar3 != 0)) {
          if ((pcVar2 != "tongue_grab") && (iVar3 = _V_stricmp(pcVar2,"tongue_grab"), iVar3 != 0)) {
            return;
          }
          iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
          pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
          if (this_00 != pCVar4) {
            return;
          }
          this[0x10] = (CTongueChokeAwardTemplate)0x0;
          return;
        }
        iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"attacker",0);
        pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
        iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
        pCVar6 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
        if ((this_00 == pCVar6) || (this_00 != pCVar4)) {
          if (this_00 != pCVar6) {
            return;
          }
          this[0x10] = (CTongueChokeAwardTemplate)0x0;
          *(undefined4 *)(this + 0x14) = 0;
          return;
        }
        if (pCVar6 == (CBaseEntity *)0x0) {
          return;
        }
        iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"type",0);
        if (iVar3 != 0x100000) {
          return;
        }
        if (this[0x10] == (CTongueChokeAwardTemplate)0x0) {
          return;
        }
      }
      this[0x10] = (CTongueChokeAwardTemplate)0x0;
      (**(code **)(*(int *)this + 0x14))(this,0x72,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)