L L4D2node

CDirector::OnPlayerDisconnected

0x00882910 · 246 bytes · __thiscall

_ZN9CDirector20OnPlayerDisconnectedEP13CTerrorPlayer

Decompiled

undefined (2 params)

/* CDirector::OnPlayerDisconnected(CTerrorPlayer*) */

void __thiscall CDirector::OnPlayerDisconnected(CDirector *this,CTerrorPlayer *param_1)

{
  int *piVar1;
  char cVar2;
  int iVar3;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  int local_20 [5];
  
  (**(code **)(**(int **)(this + 0x634) + 0x20))(*(int **)(this + 0x634),param_1);
  cVar2 = (**(code **)(*(int *)param_1 + 300))(param_1);
  if ((cVar2 != '\0') && (iVar3 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1), iVar3 == 3)) {
    OnZombieRemoved(this,param_1);
  }
  local_20[0] = 0;
  local_20[1] = 0;
  local_20[2] = 0;
  local_20[3] = 0;
  local_20[4] = 0;
  local_30 = 0xffffffff;
  local_2c = 7;
  local_28 = 3;
  local_24 = 9;
                    /* try { // try from 00882988 to 008829b4 has its CatchHandler @ 00882a0a */
  ForEachTerrorPlayer<PlayerCollector>((PlayerCollector *)&local_30);
  iVar3 = 0;
  if (0 < local_20[3]) {
    do {
      piVar1 = *(int **)(local_20[0] + iVar3 * 4);
      (**(code **)(*piVar1 + 0x8b8))(piVar1,param_1);
      iVar3 = iVar3 + 1;
    } while (iVar3 < local_20[3]);
  }
  local_20[3] = 0;
  CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)local_20);
  local_20[4] = local_20[0];
  CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)local_20);
  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)