L L4D2node

CDirector::OnChangeMissionVote

0x00876d30 · 439 bytes · __thiscall

_ZN9CDirector19OnChangeMissionVoteEPKc

Decompiled

undefined (2 params)

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

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

{
  int *piVar1;
  KeyValues *pKVar2;
  char *pcVar3;
  int iVar4;
  longdouble lVar5;
  DispatchPlayerReportFlush local_1d [13];
  
  piVar1 = (int *)(**(code **)(*g_pMatchFramework + 0x28))(g_pMatchFramework);
  pKVar2 = (KeyValues *)(**(code **)(*piVar1 + 4))(piVar1,0);
  if (pKVar2 != (KeyValues *)0x0) {
                    /* try { // try from 00876d71 to 00876dc6 has its CatchHandler @ 00876ef3 */
    KeyValues::SetString(pKVar2,"Game/campaign",param_1);
    KeyValues::SetInt(pKVar2,"Game/chapter",1);
    pKVar2 = (KeyValues *)(**(code **)(*g_pMatchExtL4D + 8))(g_pMatchExtL4D,pKVar2,0);
    if (pKVar2 == (KeyValues *)0x0) {
LAB_00876eb2:
      KeyValues::deleteThis();
      return;
    }
    pcVar3 = (char *)KeyValues::GetString(pKVar2,"map","");
    if ((pcVar3 != (char *)0x0) && (*pcVar3 != '\0')) {
                    /* try { // try from 00876df6 to 00876eb1 has its CatchHandler @ 00876ef3 */
      iVar4 = (**(code **)(*engine + 4))(engine,pcVar3);
      if (iVar4 != 0) {
        ForEachTerrorPlayer<DispatchPlayerReportFlush>(local_1d);
        UTIL_LogPrintf("change mission now vote - changing to %s (%s)\n",param_1,pcVar3);
        *(undefined4 *)(this + 0x3b0) = 0;
        lVar5 = (longdouble)IntervalTimer::Now();
        if ((float)lVar5 != *(float *)(this + 0x3ac)) {
                    /* try { // try from 00876ede to 00876ee0 has its CatchHandler @ 00876ef3 */
          (**(code **)(*(int *)(this + 0x3a8) + 4))(this + 0x3a8,this + 0x3ac);
          *(float *)(this + 0x3ac) = (float)lVar5;
        }
        V_strncpy((char *)(this + 0x3b4),pcVar3,0x20);
        ClearTransitionedLandmarkName();
        ClearTeamScores(this,true);
        (**(code **)(*(int *)this + 0x28))(this,0);
        (**(code **)(*g_pGameRules + 0x9c))(g_pGameRules,pcVar3);
        DirectorChangelevel((char *)this,pcVar3);
        goto LAB_00876eb2;
      }
    }
    KeyValues::deleteThis();
  }
  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)