L L4D2node

CDirector::CheckForDeadPlayers

0x00884420 · 702 bytes · __thiscall

_ZN9CDirector19CheckForDeadPlayersEv

Decompiled

undefined (1 param)

/* CDirector::CheckForDeadPlayers() */

void __thiscall CDirector::CheckForDeadPlayers(CDirector *this)

{
  int iVar1;
  char cVar2;
  CDirector CVar3;
  int iVar4;
  bool bVar5;
  bool bVar6;
  longdouble lVar7;
  undefined4 local_4c;
  int local_48;
  undefined4 local_44;
  int local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined1 local_34;
  int local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined1 local_24;
  int local_20;
  
  if (((*(char *)(*(int *)(this + 0x638) + 0x140) != '\0') &&
      (*(char *)(*(int *)(this + 0x638) + 0x141) != '\0')) &&
     (cVar2 = CTerrorGameRules::IsSoloMode(), cVar2 != '\0')) {
    return;
  }
  local_38 = 2;
  local_34 = 1;
  local_30 = 0;
  local_3c = 0xffffffff;
  ForEachPlayer<PlayerCounter>((PlayerCounter *)&local_3c);
  local_28 = 3;
  local_24 = 0;
  local_20 = 0;
  local_2c = 0xffffffff;
  ForEachPlayer<PlayerCounter>((PlayerCounter *)&local_2c);
  iVar1 = local_20;
  local_4c = 1;
  local_48 = 0;
  ForEachPlayer<LiveSurvivorCounter>((LiveSurvivorCounter *)&local_4c);
  iVar4 = local_48;
  if (((local_48 != 0) && (*(int *)(AllowAllBotGame._28_4_ + 0x30) == 0)) &&
     ((m_isTransitioning == '\0' && (this[0x28c] == (CDirector)0x0)))) {
    local_44 = 4;
    local_40 = 0;
    ForEachPlayer<LiveSurvivorCounter>((LiveSurvivorCounter *)&local_44);
    if (*(int *)(allow_all_bot_survivor_team._28_4_ + 0x30) == 0) {
      if (local_40 < iVar4) {
        iVar4 = local_40;
      }
      if (iVar4 == 0) {
        lVar7 = (longdouble)CountdownTimer::Now();
        if ((float)lVar7 < *(float *)(this + 0x4f0)) {
          return;
        }
        goto LAB_00884570;
      }
    }
    cVar2 = CTerrorGameRules::HasPlayerControlledZombies();
    if (((cVar2 == '\0') || (0 < iVar1)) && (0.0 < *(float *)(this + 0x4f0))) {
      if (*(float *)(this + 0x4f0) != -1.0) {
        (**(code **)(*(int *)(this + 0x4e8) + 4))(this + 0x4e8,this + 0x4f0);
        *(undefined4 *)(this + 0x4f0) = 0xbf800000;
      }
    }
  }
LAB_00884570:
  cVar2 = CTerrorGameRules::HasPlayerControlledZombies();
  if (cVar2 == '\0') {
    this[0x280] = (CDirector)(0 < local_30);
  }
  else {
    lVar7 = (longdouble)CountdownTimer::Now();
    if (*(float *)(this + 0x4f0) <= (float)lVar7) {
      this[0x280] = (CDirector)0x1;
    }
    else if (*(int *)(allow_all_bot_survivor_team._28_4_ + 0x30) == 0) {
      this[0x280] = (CDirector)(0 < local_30 && 0 < local_20);
    }
    else {
      this[0x280] = (CDirector)(0 < local_20);
    }
  }
  bVar5 = *(int *)(AllowAllBotGame._28_4_ + 0x30) != 0;
  if (bVar5) {
    this[0x280] = (CDirector)0x1;
  }
  if ((this[0x281] == (CDirector)0x0) && (iVar4 < 1)) {
    CVar3 = (CDirector)(0 < iVar1);
  }
  else {
    this[0x281] = (CDirector)0x1;
    CVar3 = (CDirector)0x1;
  }
  this[0x282] = CVar3;
  bVar6 = local_30 != 0;
  if ((bVar5) || (cVar2 = CTerrorGameRules::HasPlayerControlledZombies(), cVar2 == '\0')) {
    bVar5 = true;
  }
  else {
    bVar5 = 0 < iVar1;
  }
  if (((this[0x280] != (CDirector)0x0) &&
      (((this[0x281] != (CDirector)0x0 || (*(int *)(allow_all_bot_survivor_team._28_4_ + 0x30) != 0)
        ) && (bVar5)))) && (bVar6 && iVar4 == 0)) {
    InitiateEndScenario(this);
  }
  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)