L L4D2node

CDirector::OnChangeChapterVote

0x00876f10 · 242 bytes · __thiscall

_ZN9CDirector19OnChangeChapterVoteEPKc

Decompiled

undefined (2 params)

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

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

{
  int iVar1;
  longdouble lVar2;
  DispatchPlayerReportFlush local_1d [13];
  
  iVar1 = (**(code **)(*engine + 4))(engine,param_1);
  if (iVar1 == 0) {
    return;
  }
  ForEachTerrorPlayer<DispatchPlayerReportFlush>(local_1d);
  UTIL_LogPrintf("change chapter now vote - changing to %s\n",param_1);
  *(undefined4 *)(this + 0x3b0) = 0;
  lVar2 = (longdouble)IntervalTimer::Now();
  if ((float)lVar2 != *(float *)(this + 0x3ac)) {
    (**(code **)(*(int *)(this + 0x3a8) + 4))(this + 0x3a8,this + 0x3ac);
    *(float *)(this + 0x3ac) = (float)lVar2;
  }
  V_strncpy((char *)(this + 0x3b4),param_1,0x20);
  (**(code **)(*(int *)this + 0x28))(this,0);
  (**(code **)(*g_pGameRules + 0x9c))(g_pGameRules,param_1);
  DirectorChangelevel((char *)this,param_1);
  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)