L L4D2node

CDirectorChallengeMode::OnGameplayStart

0x008a10e0 · 562 bytes · __thiscall

_ZN22CDirectorChallengeMode15OnGameplayStartEv

Decompiled

undefined (1 param)

/* CDirectorChallengeMode::OnGameplayStart() */

void __thiscall CDirectorChallengeMode::OnGameplayStart(CDirectorChallengeMode *this)

{
  undefined4 *puVar1;
  char cVar2;
  int iVar3;
  int iVar4;
  undefined1 *puVar5;
  void *local_40 [2];
  undefined2 local_38;
  ushort local_36;
  void *local_34;
  undefined4 local_30;
  undefined2 local_2c;
  ushort local_2a;
  undefined1 *local_28;
  undefined4 local_24;
  undefined2 local_20;
  ushort local_1e;
  
  if (this[1] != (CDirectorChallengeMode)0x0) {
    cVar2 = VIPTarget();
    if ((cVar2 != '\0') ||
       ((this[1] != (CDirectorChallengeMode)0x0 && (cVar2 = HealingGnome(), cVar2 != '\0')))) {
      cVar2 = CDirector::IsSessionStartMap(TheDirector);
      if (cVar2 != '\0') {
        SpawnVIPGnome();
      }
      FindRescueAreaTrigger(this);
    }
    iVar3 = CDirector::GetScriptValue(TheDirector,"cm_FirstManOut",0);
    if (iVar3 != 0) {
      ModifyRescueAreaTrigger(this);
    }
    local_38 = 0;
    local_36 = 0;
    local_40[0] = (void *)0x0;
    puVar5 = &DAT_00d539c2;
    if (*(undefined1 **)(gpGlobals + 0x3c) != (undefined1 *)0x0) {
      puVar5 = *(undefined1 **)(gpGlobals + 0x3c);
    }
                    /* try { // try from 008a1172 to 008a1176 has its CatchHandler @ 008a131f */
    local_34 = (void *)CDirector::GetGameMode();
    puVar1 = *(undefined4 **)(this + 0x140);
    local_2a = 0;
    local_1e = 0;
    local_30 = 0;
    local_2c = 0x1f;
    local_24 = 0;
    local_20 = 0x1f;
                    /* try { // try from 008a11db to 008a1235 has its CatchHandler @ 008a133a */
    local_28 = puVar5;
    iVar3 = (**(code **)(*g_pScriptVM + 0x48))(g_pScriptVM,"ScriptMode_OnGameplayStart",*puVar1,0);
    if (iVar3 == 0) {
      iVar4 = -1;
    }
    else {
      iVar4 = (**(code **)(*g_pScriptVM + 0x50))(g_pScriptVM,iVar3,&local_34,2,local_40,*puVar1,1);
      (**(code **)(*g_pScriptVM + 0x4c))(g_pScriptVM,iVar3);
    }
    if ((local_1e & 1) != 0) {
      free(local_28);
      local_1e = local_1e & 0xfffe;
    }
    local_28 = (undefined1 *)0x0;
    local_24 = 0;
    local_20 = 0;
    if ((local_2a & 1) != 0) {
      free(local_34);
    }
    if (iVar4 == -1) {
      if (*this == (CDirectorChallengeMode)0x0) {
                    /* try { // try from 008a127e to 008a1282 has its CatchHandler @ 008a131f */
        ActivateScriptedMode(this);
      }
    }
    else {
      cVar2 = (char)local_40[0];
                    /* try { // try from 008a12c4 to 008a12db has its CatchHandler @ 008a131f */
      CDirector::PostRunScript(TheDirector);
      if ((*this == (CDirectorChallengeMode)0x0) && (cVar2 != '\0')) {
        ActivateScriptedMode(this);
      }
    }
    if ((local_36 & 1) != 0) {
      free(local_40[0]);
      return;
    }
  }
  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)