L L4D2node

CFinaleTrigger::StartSurvival

0x004e97e0 · 336 bytes · __thiscall

_ZN14CFinaleTrigger13StartSurvivalEP13CTerrorPlayer

Decompiled

undefined (2 params)

/* CFinaleTrigger::StartSurvival(CTerrorPlayer*) */

void __thiscall CFinaleTrigger::StartSurvival(CFinaleTrigger *this,CTerrorPlayer *param_1)

{
  CBaseEdict *this_00;
  int iVar1;
  char *pcVar2;
  undefined4 *puVar3;
  int in_GS_OFFSET;
  byte bVar4;
  undefined4 local_12c;
  char *local_128;
  char *local_124;
  char local_120 [4];
  undefined4 local_11c [63];
  int local_20;
  
  bVar4 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (*(int *)(this + 0x1620) != 4) {
    if (this[0x6c] == (CFinaleTrigger)0x0) {
      this_00 = *(CBaseEdict **)(this + 0x30);
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
        iVar1 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar1 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CFinaleTrigger)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x1620) = 4;
  }
  puVar3 = local_11c;
  for (iVar1 = 0x3f; iVar1 != 0; iVar1 = iVar1 + -1) {
    *puVar3 = 0;
    puVar3 = puVar3 + (uint)bVar4 * -2 + 1;
  }
  local_120[0] = '\0';
  local_120[1] = '\0';
  local_120[2] = '\0';
  local_120[3] = '\0';
  V_strncat(local_120,"TriggeredBy:",0x100,-1);
  pcVar2 = (char *)SurvivorCharacterName(*(undefined4 *)(param_1 + 0x2ba0));
  V_strncat(local_120,pcVar2,0x100,-1);
  local_128 = "FinaleTriggered";
  local_12c = 0;
  local_124 = local_120;
  ForEachTerrorPlayer<DispatchResponseToSurvivors>((DispatchResponseToSurvivors *)&local_12c);
  CDirectorSurvivalMode::OnSurvivalRoundStarted
            (*(CDirectorSurvivalMode **)(TheDirector + 0x640),0,1);
  COutputEvent::FireOutput
            ((COutputEvent *)(this + 0x15c4),(CBaseEntity *)this,(CBaseEntity *)this,0.0);
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)