L L4D2node

CDirector::RestartScenarioFromVote

0x00884700 · 363 bytes · __thiscall

_ZN9CDirector23RestartScenarioFromVoteEPKc

Decompiled

undefined (2 params)

/* CDirector::RestartScenarioFromVote(char const*) */

void __thiscall CDirector::RestartScenarioFromVote(CDirector *this,char *param_1)

{
  char *pcVar1;
  int iVar2;
  char *pcVar3;
  longdouble lVar4;
  DispatchPlayerReportFlush local_1d [13];
  
  ClearTeamScores(this,true);
  pcVar1 = *(char **)(gpGlobals + 0x3c);
  if (pcVar1 == (char *)0x0) {
    pcVar1 = "";
  }
  pcVar3 = pcVar1;
  if (((param_1 != (char *)0x0) && (pcVar3 = param_1, param_1 != pcVar1)) &&
     (iVar2 = _V_stricmp(param_1,pcVar1), iVar2 != 0)) {
    *(undefined4 *)(this + 0x284) = 0;
    ForEachTerrorPlayer<DispatchPlayerReportFlush>(local_1d);
    UTIL_LogPrintf("RestartScenarioFromVote - changing to map %s\n",param_1);
    *(undefined4 *)(this + 0x3b0) = 0;
    lVar4 = (longdouble)IntervalTimer::Now();
    if ((float)lVar4 != *(float *)(this + 0x3ac)) {
      (**(code **)(*(int *)(this + 0x3a8) + 4))(this + 0x3a8,this + 0x3ac);
      *(float *)(this + 0x3ac) = (float)lVar4;
    }
    V_strncpy((char *)(this + 0x3b4),param_1,0x20);
    ClearTransitionedLandmarkName();
    (**(code **)(*(int *)this + 0x28))(this,0);
    (**(code **)(*g_pGameRules + 0x9c))(g_pGameRules,param_1);
    DirectorChangelevel((char *)this,param_1);
    return;
  }
  V_strncpy((char *)(this + 0x3b4),pcVar3,0x20);
  if (*(float *)(this + 0x270) <= 0.0) {
    EndScenario();
    return;
  }
  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)