L L4D2node

CSceneEntity::OnSceneFinished

0x00814260 · 749 bytes · __thiscall

_ZN12CSceneEntity15OnSceneFinishedEbb

Decompiled

undefined (3 params)

/* CSceneEntity::OnSceneFinished(bool, bool) */

void __thiscall CSceneEntity::OnSceneFinished(CSceneEntity *this,bool param_1,bool param_2)

{
  uint uVar1;
  CBaseEdict *pCVar2;
  undefined1 *puVar3;
  int iVar4;
  int *piVar5;
  CChoreoScene *pCVar6;
  CSceneManager *this_00;
  undefined *puVar7;
  int iVar8;
  
  if (*(int *)(this + 0x4f0) != 0) {
    puVar3 = &DAT_00d539c2;
    if (*(undefined1 **)(this + 0x444) != (undefined1 *)0x0) {
      puVar3 = *(undefined1 **)(this + 0x444);
    }
    iVar8 = 0;
    Scene_Printf("%s : %8.2f:  finished\n",puVar3,(double)*(float *)(this + 0x49c));
    iVar4 = *(int *)(this + 0x6dc);
    if (0 < iVar4) {
      do {
        while ((((uVar1 = *(uint *)(*(int *)(this + 0x6d0) + iVar8 * 4), uVar1 != 0xffffffff &&
                 (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc
                 )) && (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) &&
               (piVar5 = *(int **)(puVar7 + 4), piVar5 != (int *)0x0))) {
          iVar8 = iVar8 + 1;
          (**(code **)(*piVar5 + 0x350))(piVar5,this);
          if (iVar8 == iVar4) goto LAB_0081431c;
        }
        iVar8 = iVar8 + 1;
      } while (iVar8 != iVar4);
    }
LAB_0081431c:
    *(undefined4 *)(this + 0x6dc) = 0;
    CChoreoScene::ResetSimulation(*(CChoreoScene **)(this + 0x4f0),true,0.0,0.0);
    if (this[0x494] != (CSceneEntity)0x0) {
      if (this[0x6c] == (CSceneEntity)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CSceneEntity)((byte)this[0x70] | 1);
      }
      this[0x494] = (CSceneEntity)0x0;
    }
    if (this[0x495] != (CSceneEntity)0x0) {
      if (this[0x6c] == (CSceneEntity)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CSceneEntity)((byte)this[0x70] | 1);
      }
      this[0x495] = (CSceneEntity)0x0;
    }
    SetCurrentTime(this,0.0,false);
    (**(code **)(*(int *)this + 0x344))(this);
    if ((param_2) && (this[0x6cc] == (CSceneEntity)0x0)) {
      COutputEvent::FireOutput
                ((COutputEvent *)(this + 0x510),(CBaseEntity *)this,(CBaseEntity *)this,0.0);
    }
    iVar4 = (**(code **)(*(int *)this + 0x3dc))(this,0);
    if (iVar4 != 0) {
      piVar5 = (int *)__dynamic_cast(iVar4,&CBaseFlex::typeinfo,&CBaseMultiplayerPlayer::typeinfo);
      if (piVar5 == (int *)0x0) {
        iVar4 = __dynamic_cast(iVar4,&CBaseFlex::typeinfo,&CFlexExpresser::typeinfo);
        if (iVar4 != 0) {
          (**(code **)(**(int **)(iVar4 + 0x1908) + 0xc))(*(int **)(iVar4 + 0x1908));
        }
      }
      else {
        piVar5 = (int *)(**(code **)(*piVar5 + 0x77c))(piVar5);
        (**(code **)(*piVar5 + 0xc))(piVar5);
      }
    }
    ClearSceneEvents(this,*(CChoreoScene **)(this + 0x4f0),param_1);
    for (iVar4 = 0; iVar8 = CChoreoScene::GetNumActors(*(CChoreoScene **)(this + 0x4f0)),
        iVar4 < iVar8; iVar4 = iVar4 + 1) {
      pCVar6 = (CChoreoScene *)(**(code **)(*(int *)this + 0x3dc))(this,iVar4);
      if ((pCVar6 != (CChoreoScene *)0x0) &&
         (CBaseFlex::RemoveChoreoScene(pCVar6,SUB41(*(undefined4 *)(this + 0x4f0),0)),
         this[0x4bf] != (CSceneEntity)0x0)) {
        this_00 = (CSceneManager *)GetSceneManager();
        CSceneManager::QueueActorsScenesToResume(this_00,(CBaseFlex *)pCVar6,false);
      }
    }
  }
  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)