L L4D2node

COuttroStats::PZEndThink

0x00687380 · 559 bytes · __thiscall

_ZN12COuttroStats10PZEndThinkEv

Decompiled

undefined (1 param)

/* COuttroStats::PZEndThink() */

void __thiscall COuttroStats::PZEndThink(COuttroStats *this)

{
  float fVar1;
  longdouble lVar2;
  int local_5c;
  int local_58;
  int local_54;
  int local_50;
  int local_4c;
  int local_48;
  int local_44;
  int local_40;
  undefined **local_3c [11];
  
  CalcPZStats(this,(SEndGameVoteStats *)&local_5c);
  lVar2 = (longdouble)CountdownTimer::Now();
  if ((*(float *)(this + 0x460) <= (float)lVar2) || ((local_44 != 0 && (local_40 != 0)))) {
    if (*(int *)(this + 0x4b4) == 0) {
      if (((local_5c == 0) || (local_4c < local_54)) && ((local_58 == 0 || (local_48 < local_50))))
      {
        *(undefined4 *)(this + 0x4b4) = 1;
      }
      else {
        *(undefined4 *)(this + 0x4b4) = 2;
      }
      fVar1 = *(float *)(sv_pz_endgame_vote_post_period._28_4_ + 0x2c);
      lVar2 = (longdouble)CountdownTimer::Now();
      if ((float)lVar2 + fVar1 != *(float *)(this + 0x46c)) {
        (**(code **)(*(int *)(this + 0x464) + 4))(this + 0x464,this + 0x46c);
        *(float *)(this + 0x46c) = (float)lVar2 + fVar1;
      }
      if (fVar1 != *(float *)(this + 0x468)) {
        (**(code **)(*(int *)(this + 0x464) + 4))(this + 0x464,this + 0x468);
        *(float *)(this + 0x468) = fVar1;
      }
      SendPZEndGameMessage(this,(SEndGameVoteStats *)&local_5c);
    }
    lVar2 = (longdouble)CountdownTimer::Now();
    if (*(float *)(this + 0x46c) <= (float)lVar2) {
      if (g_voteController != (CVoteController *)0x0) {
        CVoteController::DecrementVoteBlock(g_voteController);
      }
      CDirector::HideScoreboard(TheDirector);
      CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_3c);
      local_3c[0] = &PTR__CBroadcastRecipientFilter_00c09928;
                    /* try { // try from 0068745f to 00687463 has its CatchHandler @ 006875e3 */
      CRecipientFilter::AddAllPlayers((CRecipientFilter *)local_3c);
      local_3c[0] = &PTR__CReliableBroadcastRecipientFilter_00c157a8;
                    /* try { // try from 0068746e to 00687472 has its CatchHandler @ 006875f5 */
      CRecipientFilter::MakeReliable((CRecipientFilter *)local_3c);
                    /* try { // try from 0068747e to 006874ad has its CatchHandler @ 006875ca */
      UserMessageBegin((IRecipientFilter *)local_3c,"PZEndGamePanelMsg");
      MessageWriteByte(0);
      MessageEnd();
      if (*(int *)(this + 0x4b4) == 1) {
                    /* try { // try from 006875c0 to 006875c4 has its CatchHandler @ 006875ca */
        CDirector::Rematch(TheDirector);
      }
      else {
        CDirector::FinishScenarioExit(TheDirector);
      }
      local_3c[0] = &PTR__CBroadcastRecipientFilter_00c09928;
      CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_3c);
      return;
    }
  }
  CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 1.0,(char *)0x0);
  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)