L L4D2node

CFinaleTrigger::StartFinale

0x004e9480 · 538 bytes · __thiscall

_ZN14CFinaleTrigger11StartFinaleEP13CTerrorPlayer

Decompiled

undefined (2 params)

/* CFinaleTrigger::StartFinale(CTerrorPlayer*) */

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

{
  CBaseEdict *pCVar1;
  int iVar2;
  char *pcVar3;
  int *piVar4;
  undefined4 *puVar5;
  int in_GS_OFFSET;
  byte bVar6;
  undefined4 local_12c;
  char *local_128;
  char *local_124;
  char local_120 [4];
  undefined4 local_11c [63];
  int local_20;
  
  bVar6 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_1 == (CTerrorPlayer *)0x0) {
    if (*(int *)(this + 0x1620) != 2) {
      if (this[0x6c] == (CFinaleTrigger)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar2 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar2 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CFinaleTrigger)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + 0x1620) = 2;
    }
  }
  else {
    if (*(int *)(this + 0x1620) != 4) {
      if (this[0x6c] == (CFinaleTrigger)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar2 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar2 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CFinaleTrigger)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + 0x1620) = 4;
    }
    puVar5 = local_11c;
    for (iVar2 = 0x3f; iVar2 != 0; iVar2 = iVar2 + -1) {
      *puVar5 = 0;
      puVar5 = puVar5 + (uint)bVar6 * -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);
    pcVar3 = (char *)SurvivorCharacterName(*(undefined4 *)(param_1 + 0x2ba0));
    V_strncat(local_120,pcVar3,0x100,-1);
    local_128 = "FinaleTriggered";
    local_12c = 0;
    local_124 = local_120;
    ForEachTerrorPlayer<DispatchResponseToSurvivors>((DispatchResponseToSurvivors *)&local_12c);
    piVar4 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                              (gameeventmanager,"finale_radio_start",0,0);
    if (piVar4 != (int *)0x0) {
      (**(code **)(*piVar4 + 0x30))(piVar4,"health",*(undefined4 *)(this + 0x100));
      (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar4,0);
    }
    CDirector::OnFinaleStarted(TheDirector,*(undefined4 *)(this + 0x1624));
    pcVar3 = *(char **)(this + 0x1610);
    if (pcVar3 == (char *)0x0) {
      pcVar3 = "";
    }
    iVar2 = _V_strlen(pcVar3);
    if (0 < iVar2) {
      pcVar3 = "";
      if (*(char **)(this + 0x1610) != (char *)0x0) {
        pcVar3 = *(char **)(this + 0x1610);
      }
      CDirector::BeginLocalScript(TheDirector,pcVar3);
    }
    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)