L L4D2node

CSceneEntity::StartPlayback

0x008192c0 · 976 bytes · __thiscall

_ZN12CSceneEntity13StartPlaybackEv

Decompiled

undefined (1 param)

/* CSceneEntity::StartPlayback() */

void __thiscall CSceneEntity::StartPlayback(CSceneEntity *this)

{
  uint uVar1;
  CBaseEdict *this_00;
  char cVar2;
  int iVar3;
  char *pcVar4;
  CBaseEdict *pCVar5;
  undefined *puVar6;
  undefined1 *puVar7;
  int iVar8;
  code *local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined2 local_60;
  undefined2 local_5e;
  undefined2 local_5c;
  undefined2 local_5a;
  undefined4 local_58;
  CUtlSymbolTable local_54 [68];
  
  if (*(int *)(this + 0x4f0) == 0) {
    if (this[0x4ec] != (CSceneEntity)0x0) {
      return;
    }
    pcVar4 = *(char **)(this + 0x444);
    if (pcVar4 == (char *)0x0) {
      pcVar4 = "";
    }
    iVar3 = LoadScene(pcVar4,(IChoreoEventCallback *)(this + 0x440));
    *(int *)(this + 0x4f0) = iVar3;
    if (iVar3 == 0) {
      puVar7 = *(undefined1 **)(this + 0x444);
      if (puVar7 == (undefined1 *)0x0) {
        puVar7 = &DAT_00d539c2;
      }
      DevMsg("%s missing from scenes.image\n",puVar7);
      this[0x4ec] = (CSceneEntity)0x1;
      return;
    }
    (**(code **)(*(int *)this + 0x334))(this);
    cVar2 = ShouldNetwork(this);
    if (cVar2 != '\0') {
      puVar7 = *(undefined1 **)(this + 0x444);
      if (puVar7 == (undefined1 *)0x0) {
        puVar7 = &DAT_00d539c2;
      }
      iVar3 = (**(code **)(*g_pStringTableClientSideChoreoScenes + 0x24))
                        (g_pStringTableClientSideChoreoScenes,1,puVar7,0xffffffff,0);
      if (iVar3 != *(int *)(this + 0x4f4)) {
        if (this[0x6c] == (CSceneEntity)0x0) {
          pCVar5 = *(CBaseEdict **)(this + 0x30);
          if (pCVar5 != (CBaseEdict *)0x0) {
            *(uint *)pCVar5 = *(uint *)pCVar5 | 0x101;
            iVar8 = CBaseEdict::GetChangeAccessor(pCVar5);
            *(undefined2 *)(iVar8 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CSceneEntity)((byte)this[0x70] | 1);
        }
        *(int *)(this + 0x4f4) = iVar3;
      }
    }
    (**(code **)(*(int *)this + 0x58))(this);
  }
  if ((this[0x494] != (CSceneEntity)0x0) || (cVar2 = CheckActors(this), cVar2 == '\0')) {
    return;
  }
  this[0x6cc] = (CSceneEntity)0x0;
  this[0x4bd] = (CSceneEntity)0x0;
  this[0x4be] = (CSceneEntity)0x0;
  if (this[0x494] == (CSceneEntity)0x1) {
    pCVar5 = *(CBaseEdict **)(this + 0x30);
  }
  else {
    if (this[0x6c] == (CSceneEntity)0x0) {
      this_00 = *(CBaseEdict **)(this + 0x30);
      pCVar5 = (CBaseEdict *)0x0;
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar3 + 2) = 0;
        pCVar5 = *(CBaseEdict **)(this + 0x30);
      }
    }
    else {
      this[0x70] = (CSceneEntity)((byte)this[0x70] | 1);
      pCVar5 = *(CBaseEdict **)(this + 0x30);
    }
    this[0x494] = (CSceneEntity)0x1;
  }
  if (pCVar5 != (CBaseEdict *)0x0) {
    *(uint *)pCVar5 = *(uint *)pCVar5 | 0x101;
    iVar3 = CBaseEdict::GetChangeAccessor(pCVar5);
    *(undefined2 *)(iVar3 + 2) = 0;
  }
  if (this[0x495] != (CSceneEntity)0x0) {
    if (this[0x6c] == (CSceneEntity)0x0) {
      pCVar5 = *(CBaseEdict **)(this + 0x30);
      if (pCVar5 != (CBaseEdict *)0x0) {
        *(uint *)pCVar5 = *(uint *)pCVar5 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar5);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CSceneEntity)((byte)this[0x70] | 1);
    }
    this[0x495] = (CSceneEntity)0x0;
  }
  SetCurrentTime(this,0.0,true);
  CChoreoScene::ResetSimulation(*(CChoreoScene **)(this + 0x4f0),true,0.0,0.0);
  (**(code **)(*(int *)this + 0x344))(this);
  ClearSceneEvents(this,*(CChoreoScene **)(this + 0x4f0),false);
  COutputEvent::FireOutput
            ((COutputEvent *)(this + 0x4f8),(CBaseEntity *)this,(CBaseEntity *)this,0.0);
  CUtlSymbolTable::CUtlSymbolTable(local_54,0,0x10,false);
  local_5a = 0xffff;
  local_70 = SpeakEventSoundLessFunc;
  local_6c = 0;
  local_68 = 0;
  local_64 = 0;
  local_60 = 0xffff;
  local_5e = 0;
  local_5c = 0xffff;
  local_58 = 0;
                    /* try { // try from 00819459 to 008194f2 has its CatchHandler @ 008196b3 */
  BuildSortedSpeakEventSoundsPrefetchList
            (this,*(CChoreoScene **)(this + 0x4f0),local_54,(CUtlRBTree *)&local_70,0.0);
  PrefetchSpeakEventSounds(this,local_54,(CUtlRBTree *)&local_70);
  iVar3 = *(int *)(this + 0x6f0);
  iVar8 = 0;
  if (0 < iVar3) {
    do {
      while ((((uVar1 = *(uint *)(*(int *)(this + 0x6e4) + iVar8 * 4), uVar1 == 0xffffffff ||
               (puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc))
              || (*(uint *)(puVar6 + 8) != uVar1 >> 0xc)) ||
             (*(CSceneListManager **)(puVar6 + 4) == (CSceneListManager *)0x0))) {
        iVar8 = iVar8 + 1;
        if (iVar8 == iVar3) goto LAB_008194e1;
      }
      CSceneListManager::SceneStarted(*(CSceneListManager **)(puVar6 + 4),(CBaseEntity *)this);
      iVar8 = iVar8 + 1;
    } while (iVar8 != iVar3);
  }
LAB_008194e1:
  PrefetchAnimBlocks(this,*(CChoreoScene **)(this + 0x4f0));
  CUtlRBTree<CSceneEntity::SpeakEventSound_t,unsigned_short,bool(*)(CSceneEntity::SpeakEventSound_t_const&,CSceneEntity::SpeakEventSound_t_const&),CUtlMemory<UtlRBTreeNode_t<CSceneEntity::SpeakEventSound_t,unsigned_short>,unsigned_short>>
  ::RemoveAll((CUtlRBTree<CSceneEntity::SpeakEventSound_t,unsigned_short,bool(*)(CSceneEntity::SpeakEventSound_t_const&,CSceneEntity::SpeakEventSound_t_const&),CUtlMemory<UtlRBTreeNode_t<CSceneEntity::SpeakEventSound_t,unsigned_short>,unsigned_short>>
               *)&local_70);
  local_5c = 0xffff;
  CUtlMemory<UtlRBTreeNode_t<CSceneEntity::SpeakEventSound_t,unsigned_short>,unsigned_short>::Purge
            ((CUtlMemory<UtlRBTreeNode_t<CSceneEntity::SpeakEventSound_t,unsigned_short>,unsigned_short>
              *)&local_6c);
  local_5a = 0xffff;
  CUtlMemory<UtlRBTreeNode_t<CSceneEntity::SpeakEventSound_t,unsigned_short>,unsigned_short>::Purge
            ((CUtlMemory<UtlRBTreeNode_t<CSceneEntity::SpeakEventSound_t,unsigned_short>,unsigned_short>
              *)&local_6c);
  CUtlSymbolTable::~CUtlSymbolTable(local_54);
  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)