L L4D2node

CSceneEntity::OnRestore

0x00815610 · 741 bytes · __thiscall

_ZN12CSceneEntity9OnRestoreEv

Decompiled

undefined (1 param)

/* CSceneEntity::OnRestore() */

void __thiscall CSceneEntity::OnRestore(CSceneEntity *this)

{
  byte *pbVar1;
  CSceneEntity CVar2;
  CBaseEdict *pCVar3;
  char cVar4;
  CChoreoScene *this_00;
  CBaseFlex *this_01;
  int iVar5;
  char *pcVar6;
  undefined1 *puVar7;
  int iVar8;
  
  CBaseEntity::OnRestore((CBaseEntity *)this);
  if ((*(float *)(this + 0x4a8) < 0.25) || (2.5 < *(float *)(this + 0x4a8))) {
    *(undefined4 *)(this + 0x4a8) = 0x3f800000;
  }
  if (this[0x494] != (CSceneEntity)0x0) {
    this_00 = *(CChoreoScene **)(this + 0x4f0);
    if (this_00 == (CChoreoScene *)0x0) {
      pcVar6 = *(char **)(this + 0x444);
      if (pcVar6 == (char *)0x0) {
        pcVar6 = "";
      }
      iVar8 = LoadScene(pcVar6,(IChoreoEventCallback *)(this + 0x440));
      *(int *)(this + 0x4f0) = iVar8;
      if (iVar8 == 0) {
        this[0x4ec] = (CSceneEntity)0x1;
        return;
      }
      (**(code **)(*(int *)this + 0x334))(this);
      cVar4 = ShouldNetwork(this);
      if (cVar4 != '\0') {
        puVar7 = *(undefined1 **)(this + 0x444);
        if (puVar7 == (undefined1 *)0x0) {
          puVar7 = &DAT_00d539c2;
        }
        iVar8 = (**(code **)(*g_pStringTableClientSideChoreoScenes + 0x24))
                          (g_pStringTableClientSideChoreoScenes,1,puVar7,0xffffffff,0);
        if (iVar8 != *(int *)(this + 0x4f4)) {
          if (this[0x6c] == (CSceneEntity)0x0) {
            pCVar3 = *(CBaseEdict **)(this + 0x30);
            if (pCVar3 != (CBaseEdict *)0x0) {
              *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
              iVar5 = CBaseEdict::GetChangeAccessor(pCVar3);
              *(undefined2 *)(iVar5 + 2) = 0;
            }
          }
          else {
            this[0x70] = (CSceneEntity)((byte)this[0x70] | 1);
          }
          *(int *)(this + 0x4f4) = iVar8;
        }
      }
      (**(code **)(*(int *)this + 0x58))(this);
      this_00 = *(CChoreoScene **)(this + 0x4f0);
    }
    this[0x4ec] = (CSceneEntity)0x0;
    for (iVar8 = 0; iVar5 = CChoreoScene::GetNumActors(this_00), iVar8 < iVar5; iVar8 = iVar8 + 1) {
      this_01 = (CBaseFlex *)(**(code **)(*(int *)this + 0x3dc))(this,iVar8);
      if ((this_01 != (CBaseFlex *)0x0) &&
         (iVar5 = (**(code **)(*(int *)this_01 + 0x144))(this_01), iVar5 != 0)) {
        CBaseFlex::StartChoreoScene(this_01,*(CChoreoScene **)(this + 0x4f0));
      }
      this_00 = *(CChoreoScene **)(this + 0x4f0);
    }
    CVar2 = this[0x495];
    if (CVar2 != (CSceneEntity)0x0) {
      if (this[0x6c] == (CSceneEntity)0x0) {
        pCVar3 = *(CBaseEdict **)(this + 0x30);
        if (pCVar3 != (CBaseEdict *)0x0) {
          *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
          iVar8 = CBaseEdict::GetChangeAccessor(pCVar3);
          *(undefined2 *)(iVar8 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CSceneEntity)((byte)this[0x70] | 1);
      }
      this[0x495] = (CSceneEntity)0x0;
    }
    CChoreoScene::ResetSimulation
              (*(CChoreoScene **)(this + 0x4f0),true,*(float *)(this + 0x49c) - 0.001,
               *(float *)(this + 0x49c));
    CChoreoScene::SetTime(*(CChoreoScene **)(this + 0x4f0),*(float *)(this + 0x49c) - 0.001);
    SetCurrentTime(this,*(float *)(this + 0x49c),true);
    this[0x6f8] = (CSceneEntity)0x1;
    if (*(int *)(this + 0x4f0) != 0) {
      pbVar1 = (byte *)(*(int *)(this + 0x4f0) + 0x20c);
      *pbVar1 = *pbVar1 | 0x10;
    }
    (**(code **)(*(int *)this + 0x33c))(this,0x3a83126f);
    this[0x6f8] = (CSceneEntity)0x0;
    if (*(int *)(this + 0x4f0) != 0) {
      pbVar1 = (byte *)(*(int *)(this + 0x4f0) + 0x20c);
      *pbVar1 = *pbVar1 & 0xef;
    }
    if (CVar2 == (CSceneEntity)0x0) {
      pCVar3 = *(CBaseEdict **)(this + 0x30);
    }
    else {
      (**(code **)(*(int *)this + 0x358))(this);
      pCVar3 = *(CBaseEdict **)(this + 0x30);
    }
    if (pCVar3 != (CBaseEdict *)0x0) {
      *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
      iVar8 = CBaseEdict::GetChangeAccessor(pCVar3);
      *(undefined2 *)(iVar8 + 2) = 0;
    }
  }
  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)