L L4D2node

CHurdleAwardTemplate::FireGameEvent

0x00857680 · 1576 bytes · __thiscall

_ZN20CHurdleAwardTemplate13FireGameEventEP10IGameEvent

Decompiled

undefined (2 params)

/* CHurdleAwardTemplate::FireGameEvent(IGameEvent*) */

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

{
  char cVar1;
  char *pcVar2;
  CBaseEntity *this_00;
  int iVar3;
  CBaseEntity *pCVar4;
  undefined4 uVar5;
  int iVar6;
  int *piVar7;
  longdouble lVar8;
  float fVar9;
  CTraceFilterSimple local_dc [16];
  float local_cc;
  float local_c8;
  float local_c4;
  float local_bc;
  float local_b8;
  float local_b4;
  float local_ac;
  float local_a8;
  float local_a4;
  float local_9c;
  float local_98;
  float local_94;
  undefined4 local_8c;
  undefined1 local_88;
  undefined1 local_87;
  Vector local_70 [12];
  Vector local_64 [64];
  int *local_24;
  
  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))
  {
    if ((pcVar2 == "player_jump_apex") ||
       (iVar3 = _V_stricmp(pcVar2,"player_jump_apex"), iVar3 == 0)) {
      iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
      if (iVar3 != 0) {
        iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
        pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
        if (((this_00 == pCVar4) &&
            (cVar1 = (**(code **)(*(int *)this_00 + 0x7e8))(this_00), cVar1 == '\0')) &&
           ((*(float *)(this + 0x18) <= 0.0 ||
            (lVar8 = (longdouble)CountdownTimer::Now(), *(float *)(this + 0x18) <= (float)lVar8))))
        {
          uVar5 = (**(code **)(*(int *)this_00 + 0x7a0))(this_00,0);
          iVar3 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
          iVar6 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
          if (((byte)this_00[0x14d] & 8) == 0) {
            local_c4 = *(float *)(this_00 + 0x2e8);
            local_b8 = 0.0;
            local_bc = 0.0;
            local_b4 = local_c4 - 50.0;
            fVar9 = 0.0;
            local_cc = *(float *)(this_00 + 0x2e0);
            local_c8 = *(float *)(this_00 + 0x2e4);
          }
          else {
            CBaseEntity::CalcAbsolutePosition(this_00);
            local_c4 = *(float *)(this_00 + 0x2e8);
            local_cc = *(float *)(this_00 + 0x2e0);
            local_c8 = *(float *)(this_00 + 0x2e4);
            local_b4 = local_c4 - 50.0;
            if (((byte)this_00[0x14d] & 8) == 0) {
              local_bc = 0.0;
              local_b8 = 0.0;
              fVar9 = local_bc;
            }
            else {
              CBaseEntity::CalcAbsolutePosition(this_00);
              local_bc = local_cc - *(float *)(this_00 + 0x2e0);
              local_c4 = *(float *)(this_00 + 0x2e8);
              local_b8 = local_c8 - *(float *)(this_00 + 0x2e4);
              fVar9 = local_b8 * local_b8 + local_bc * local_bc;
              local_cc = *(float *)(this_00 + 0x2e0);
              local_c8 = *(float *)(this_00 + 0x2e4);
            }
          }
          local_b4 = local_b4 - local_c4;
          local_8c = 0;
          local_87 = local_b4 * local_b4 + fVar9 != 0.0;
          local_9c = (*(float *)(iVar3 + 0x18) - *(float *)(iVar6 + 0xc)) * 0.5;
          local_98 = (*(float *)(iVar3 + 0x1c) - *(float *)(iVar6 + 0x10)) * 0.5;
          local_94 = (*(float *)(iVar3 + 0x20) - *(float *)(iVar6 + 0x14)) * 0.5;
          local_88 = local_98 * local_98 + local_9c * local_9c + local_94 * local_94 < 1e-06;
          local_ac = (*(float *)(iVar3 + 0x18) + *(float *)(iVar6 + 0xc)) * 0.5;
          local_cc = local_cc + local_ac;
          local_a8 = (*(float *)(iVar3 + 0x1c) + *(float *)(iVar6 + 0x10)) * 0.5;
          local_c8 = local_c8 + local_a8;
          local_a4 = (*(float *)(iVar3 + 0x20) + *(float *)(iVar6 + 0x14)) * 0.5;
          local_c4 = local_c4 + local_a4;
          local_ac = -local_ac;
          local_a8 = -local_a8;
          local_a4 = -local_a4;
          CTraceFilterSimple::CTraceFilterSimple
                    (local_dc,(IHandleEntity *)this_00,0,(_func_bool_IHandleEntity_ptr_int *)0x0);
          (**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,uVar5,local_dc,local_70);
          if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
            DebugDrawLine(local_70,local_64,0xff,0xff,0,true,-1.0);
          }
          if ((local_24 != (int *)0x0) &&
             (iVar3 = (**(code **)(*local_24 + 0x144))(local_24), iVar3 != 0)) {
            piVar7 = (int *)(**(code **)(*local_24 + 0x144))(local_24);
            iVar3 = (**(code **)(*piVar7 + 0x544))(piVar7);
            if (iVar3 != 8) {
              piVar7 = (int *)(**(code **)(*local_24 + 0x144))(local_24);
              iVar3 = (**(code **)(*piVar7 + 0x544))(piVar7);
              if (iVar3 != 7) {
                return;
              }
            }
            (**(code **)(*(int *)this + 0x14))(this,0x31,0);
            lVar8 = (longdouble)CountdownTimer::Now();
            if ((float)lVar8 + 1.0 != *(float *)(this + 0x18)) {
              (**(code **)(*(int *)(this + 0x10) + 4))(this + 0x10,this + 0x18);
              *(float *)(this + 0x18) = (float)lVar8 + 1.0;
            }
            if (*(float *)(this + 0x14) != 1.0) {
              (**(code **)(*(int *)(this + 0x10) + 4))(this + 0x10,this + 0x14);
              *(undefined4 *)(this + 0x14) = 0x3f800000;
            }
          }
        }
      }
    }
    else {
      if ((pcVar2 == "map_transition") || (iVar3 = _V_stricmp(pcVar2,"map_transition"), iVar3 == 0))
      {
        fVar9 = *(float *)(this + 0x18);
      }
      else {
        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;
        }
        fVar9 = *(float *)(this + 0x18);
      }
      if (fVar9 != -1.0) {
        (**(code **)(*(int *)(this + 0x10) + 4))(this + 0x10,this + 0x18);
        *(undefined4 *)(this + 0x18) = 0xbf800000;
      }
    }
  }
  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)