L L4D2node

CDirectorVersusMode::ForceVersusStart

0x008c3990 · 469 bytes · __thiscall

_ZN19CDirectorVersusMode16ForceVersusStartEv

Decompiled

undefined (1 param)

/* CDirectorVersusMode::ForceVersusStart() */

void __thiscall CDirectorVersusMode::ForceVersusStart(CDirectorVersusMode *this)

{
  bool bVar1;
  int *piVar2;
  char cVar3;
  CTerrorPlayer *pCVar4;
  int *piVar5;
  CBaseEntity *pCVar6;
  longdouble lVar7;
  undefined4 local_30 [3];
  undefined4 local_24;
  undefined4 local_20;
  
  pCVar4 = (CTerrorPlayer *)CDirectorTacticalServices::GetRandomSurvivor();
  if (pCVar4 != (CTerrorPlayer *)0x0) {
    bVar1 = false;
    pCVar6 = (CBaseEntity *)0x0;
    while (pCVar6 = (CBaseEntity *)
                    CGlobalEntityList::FindEntityByClassname
                              ((CGlobalEntityList *)gEntList,pCVar6,"prop_door_rotating_checkpoint")
          , pCVar6 != (CBaseEntity *)0x0) {
      piVar5 = (int *)__dynamic_cast(pCVar6,&CBaseEntity::typeinfo,&CBasePropDoor::typeinfo,0);
      cVar3 = (**(code **)(*piVar5 + 0x47c))(piVar5);
      piVar2 = mdlcache;
      if (((cVar3 != '\0') && (piVar5[0x57d] == 0)) &&
         ((*(byte *)((int)piVar5 + 0x149) & 0x80) == 0)) {
        (**(code **)(*mdlcache + 0x68))(mdlcache);
        if ((char)piVar5[0x589] == '\0') {
          local_30[0] = 0;
          local_24 = 0xffffffff;
          local_20 = 0;
                    /* try { // try from 008c3aa2 to 008c3aa3 has its CatchHandler @ 008c3b6c */
          (**(code **)(*piVar5 + 0xb4))(piVar5,"PlayerOpen",pCVar4,pCVar4,local_30,0x10);
          if (piVar5[0x57d] == 0) {
            bVar1 = true;
          }
        }
        else {
                    /* try { // try from 008c3a49 to 008c3a4e has its CatchHandler @ 008c3b6c */
          (**(code **)(*piVar5 + 0x488))(piVar5,pCVar4);
          bVar1 = true;
        }
        (**(code **)(*piVar2 + 0x6c))(piVar2);
      }
    }
    if (!bVar1) {
      CDirector::OnFirstSurvivorLeftSafeArea(TheDirector,pCVar4);
      return;
    }
    lVar7 = (longdouble)CountdownTimer::Now();
    if ((float)lVar7 + 0.8 != *(float *)(this + 0x24)) {
      (**(code **)(*(int *)(this + 0x1c) + 4))(this + 0x1c,this + 0x24);
      *(float *)(this + 0x24) = (float)lVar7 + 0.8;
    }
    if (*(float *)(this + 0x20) != 0.8) {
      (**(code **)(*(int *)(this + 0x1c) + 4))(this + 0x1c,this + 0x20);
      *(undefined4 *)(this + 0x20) = 0x3f4ccccd;
    }
  }
  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)