L L4D2node

CDirector::Rematch

0x00884880 · 390 bytes · __thiscall

_ZN9CDirector7RematchEv

Decompiled

undefined (1 param)

/* CDirector::Rematch() */

void __thiscall CDirector::Rematch(CDirector *this)

{
  CTerrorGameRules *this_00;
  char cVar1;
  KeyValues *this_01;
  char *pcVar2;
  longdouble lVar3;
  
  lVar3 = (longdouble)IntervalTimer::Now();
  if ((float)lVar3 != *(float *)(this + 0x3ac)) {
    (**(code **)(*(int *)(this + 0x3a8) + 4))(this + 0x3a8,this + 0x3ac);
    *(float *)(this + 0x3ac) = (float)lVar3;
  }
  *(undefined4 *)(this + 0x3b0) = 0;
  if (*(float *)(this + 0x270) != -1.0) {
    (**(code **)(*(int *)(this + 0x268) + 4))(this + 0x268,this + 0x270);
    *(undefined4 *)(this + 0x270) = 0xbf800000;
  }
  ClearTeamScores(this,true);
  this_00 = g_pGameRules;
  this[0x4e5] = (CDirector)0x0;
  this[0x4e6] = (CDirector)0x0;
  CTerrorGameRules::ResetRoundNumber(this_00);
  this[0x4e7] = (CDirector)0x0;
  cVar1 = CTerrorGameRules::IsVersusMode();
  if (cVar1 == '\0') {
    cVar1 = CTerrorGameRules::IsSurvivalMode();
    if ((cVar1 != '\0') && (cVar1 = CTerrorGameRules::HasPlayerControlledZombies(), cVar1 != '\0'))
    {
      pcVar2 = "";
      if (*(char **)(gpGlobals + 0x3c) != (char *)0x0) {
        pcVar2 = *(char **)(gpGlobals + 0x3c);
      }
      RestartScenarioFromVote(TheDirector,pcVar2);
      return;
    }
    if (*(float *)(this + 0x270) <= 0.0) {
      EndScenario();
      return;
    }
  }
  else {
    pcVar2 = *(char **)(gpGlobals + 0x3c);
    if (pcVar2 == (char *)0x0) {
      pcVar2 = "";
    }
    this_01 = (KeyValues *)CTerrorGameRules::GetMissionFirstMap((KeyValues **)0x0);
    if (this_01 != (KeyValues *)0x0) {
      pcVar2 = (char *)KeyValues::GetString(this_01,"map",pcVar2);
    }
    RestartScenarioFromVote(TheDirector,pcVar2);
  }
  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)