L L4D2node

CDirectorVersusMode::RestartVsMode

0x008c4a60 · 541 bytes · __thiscall

_ZN19CDirectorVersusMode13RestartVsModeEv

Decompiled

undefined (1 param)

/* CDirectorVersusMode::RestartVsMode() */

void __thiscall CDirectorVersusMode::RestartVsMode(CDirectorVersusMode *this)

{
  CDirector *pCVar1;
  CDirector *pCVar2;
  KeyValues *this_00;
  longdouble lVar3;
  uint in_stack_ffffffa8;
  undefined4 local_3c;
  char *local_38;
  undefined1 local_34;
  KeyValues *local_30;
  undefined4 local_2c;
  char *local_28;
  undefined1 local_24;
  undefined4 local_20;
  
  if (this[6] != (CDirectorVersusMode)0x0) {
    ForEachTerrorPlayer<MissionWon>((MissionWon *)&local_2c);
    CDirector::FinishScenarioExit(TheDirector);
    return;
  }
  if (*(int *)(TheDirector + 0x284) != 8) {
    if (TheDirector[0x4e5] == (CDirector)0x0) {
      CDirector::EndScenario(TheDirector,0);
      return;
    }
    CDirector::EndScenario(TheDirector,6);
    *(undefined4 *)(this + 0x10) = *(undefined4 *)(this + 8);
    *(undefined4 *)(this + 0x14) = *(undefined4 *)(this + 0xc);
    return;
  }
  this_00 = KeyValues::operator_new((KeyValues *)0x2c,in_stack_ffffffa8);
                    /* try { // try from 008c4b19 to 008c4b1d has its CatchHandler @ 008c4c8d */
  KeyValues::KeyValues(this_00,"scores",(IKeyValuesSystem *)0x0,false);
  if (this_00 == (KeyValues *)0x0) {
    local_3c = 0xffffffff;
    local_38 = "fullscreen_vs_scoreboard";
    local_34 = 1;
    local_30 = (KeyValues *)0x0;
    ForEachTerrorPlayer<CShowViewportPanel>((CShowViewportPanel *)&local_3c);
    local_2c = 0xffffffff;
    local_28 = "info_window";
    local_24 = 0;
    local_20 = 0;
    ForEachTerrorPlayer<CShowViewportPanel>((CShowViewportPanel *)&local_2c);
  }
  else {
    KeyValues::SetInt(this_00,"t1",*(int *)(this + 8));
    KeyValues::SetInt(this_00,"t2",*(int *)(this + 0xc));
    local_3c = 0xffffffff;
    local_38 = "fullscreen_vs_scoreboard";
    local_34 = 1;
    local_30 = this_00;
    ForEachTerrorPlayer<CShowViewportPanel>((CShowViewportPanel *)&local_3c);
    local_2c = 0xffffffff;
    local_28 = "info_window";
    local_24 = 0;
    local_20 = 0;
    ForEachTerrorPlayer<CShowViewportPanel>((CShowViewportPanel *)&local_2c);
    KeyValues::deleteThis();
  }
  pCVar2 = TheDirector;
  pCVar1 = TheDirector + 0x268;
  lVar3 = (longdouble)CountdownTimer::Now();
  if ((float)lVar3 + 12.0 != *(float *)(pCVar2 + 0x270)) {
    (**(code **)(*(int *)(pCVar2 + 0x268) + 4))(pCVar1,pCVar2 + 0x270);
    *(float *)(pCVar2 + 0x270) = (float)lVar3 + 12.0;
  }
  if (*(float *)(pCVar2 + 0x26c) != 12.0) {
    (**(code **)(*(int *)(pCVar2 + 0x268) + 4))(pCVar1,pCVar2 + 0x26c);
    *(undefined4 *)(pCVar2 + 0x26c) = 0x41400000;
  }
  this[6] = (CDirectorVersusMode)0x1;
  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)