L L4D2node

CVomitHitAwardTemplate::FireGameEvent

0x00860a00 · 1006 bytes · __thiscall

_ZN22CVomitHitAwardTemplate13FireGameEventEP10IGameEvent

Decompiled

undefined (2 params)

/* CVomitHitAwardTemplate::FireGameEvent(IGameEvent*) */

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

{
  CVomitHitAwardTemplate *pCVar1;
  char cVar2;
  char *pcVar3;
  CBaseEntity *this_00;
  int iVar4;
  CBaseEntity *pCVar5;
  int iVar6;
  longdouble lVar7;
  
  pcVar3 = (char *)(**(code **)(*(int *)param_1 + 8))(param_1);
  if (((pcVar3 != (char *)0x0) &&
      (this_00 = (CBaseEntity *)CAwardTemplate::GetOwner((CAwardTemplate *)this),
      this_00 != (CBaseEntity *)0x0)) && (iVar4 = CBaseEntity::GetTeamNumber(this_00), iVar4 == 3))
  {
    if ((pcVar3 != "player_now_it") && (iVar4 = _V_stricmp(pcVar3,"player_now_it"), iVar4 != 0)) {
      if ((pcVar3 == "player_death") || (iVar4 = _V_stricmp(pcVar3,"player_death"), iVar4 == 0)) {
        iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
        pCVar5 = (CBaseEntity *)UTIL_PlayerByUserId(iVar4);
        if (this_00 != pCVar5) {
          return;
        }
        if (pCVar5 == (CBaseEntity *)0x0) {
          return;
        }
        iVar4 = CBaseEntity::GetTeamNumber(this_00);
        if (iVar4 == 3) {
          (**(code **)(*(int *)this_00 + 0x544))(this_00);
        }
        *(undefined4 *)(this + 0x10) = 0;
        return;
      }
      if ((pcVar3 != "fatal_vomit") && (iVar4 = _V_stricmp(pcVar3,"fatal_vomit"), iVar4 != 0)) {
        return;
      }
      iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
      pCVar5 = (CBaseEntity *)UTIL_PlayerByUserId(iVar4);
      if (this_00 != pCVar5) {
        return;
      }
      if (pCVar5 == (CBaseEntity *)0x0) {
        return;
      }
      iVar4 = CBaseEntity::GetTeamNumber(this_00);
      if (iVar4 != 3) {
        return;
      }
      iVar4 = (**(code **)(*(int *)this_00 + 0x544))(this_00);
      if (iVar4 != 2) {
        return;
      }
      (**(code **)(*(int *)this + 0x14))(this,0x89,0);
      return;
    }
    iVar4 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
    iVar4 = UTIL_PlayerByUserId(iVar4);
    iVar6 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"attacker",0);
    pCVar5 = (CBaseEntity *)UTIL_PlayerByUserId(iVar6);
    cVar2 = (**(code **)(*(int *)param_1 + 0x18))(param_1,"by_boomer",0);
    if ((((cVar2 != '\0') && (iVar4 != 0)) && (pCVar5 != (CBaseEntity *)0x0)) && (this_00 == pCVar5)
       ) {
      pCVar1 = this + 0x14;
      lVar7 = (longdouble)CountdownTimer::Now();
      if (((*(float *)(this + 0x18) - *(float *)(this + 0x1c)) + (float)lVar7 < 0.0) &&
         (*(float *)(this + 0x1c) != -1.0)) {
        (**(code **)(*(int *)(this + 0x14) + 4))(pCVar1,this + 0x1c);
        *(undefined4 *)(this + 0x1c) = 0xbf800000;
      }
      lVar7 = (longdouble)CountdownTimer::Now();
      if (*(float *)(this + 0x1c) <= (float)lVar7) {
        *(int *)(this + 0x10) = *(int *)(this + 0x10) + 1;
        lVar7 = (longdouble)CountdownTimer::Now();
        if ((float)lVar7 + 5.0 != *(float *)(this + 0x1c)) {
          (**(code **)(*(int *)(this + 0x14) + 4))(pCVar1,this + 0x1c);
          *(float *)(this + 0x1c) = (float)lVar7 + 5.0;
        }
        if (*(float *)(this + 0x18) != 5.0) {
          (**(code **)(*(int *)(this + 0x14) + 4))(pCVar1,this + 0x18);
          *(undefined4 *)(this + 0x18) = 0x40a00000;
        }
        iVar4 = *(int *)(this + 0x10);
        if (iVar4 == 1) {
          (**(code **)(*(int *)this + 0x14))(this,0x84,0);
        }
        else if (iVar4 == 2) {
          (**(code **)(*(int *)this + 0x14))(this,0x85,0);
        }
        else if (iVar4 == 3) {
          (**(code **)(*(int *)this + 0x14))(this,0x86,0);
        }
        else if (iVar4 == 4) {
          (**(code **)(*(int *)this + 0x14))(this,0x87,0);
        }
        else if (iVar4 == 5) {
          (**(code **)(*(int *)this + 0x14))(this,0x88,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)