L L4D2node

CSceneEntity::LoadScene

0x008152d0 · 403 bytes · __cdecl

_ZN12CSceneEntity9LoadSceneEPKcP20IChoreoEventCallback

Decompiled

undefined (2 params)

/* CSceneEntity::LoadScene(char const*, IChoreoEventCallback*) */

CChoreoScene * CSceneEntity::LoadScene(char *param_1,IChoreoEventCallback *param_2)

{
  char cVar1;
  CChoreoScene *this;
  CChoreoScene *pCVar2;
  int in_GS_OFFSET;
  uchar *local_164;
  int local_160;
  CUtlBuffer local_15c [56];
  char local_124 [260];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  DevMsg(2,"Blocking load of scene from \'%s\'\n",param_1);
  V_strncpy(local_124,param_1,0x104);
  V_SetExtension(local_124,".vcd",0x104);
  V_FixSlashes(local_124,'/');
  cVar1 = CopySceneFileIntoMemory(local_124,&local_164,&local_160);
  if (cVar1 == '\0') {
    MissingSceneWarning(local_124);
    pCVar2 = (CChoreoScene *)0x0;
  }
  else {
    this = ::operator_new(0x218);
                    /* try { // try from 0081538a to 0081538e has its CatchHandler @ 00815483 */
    CChoreoScene::CChoreoScene(this,(IChoreoEventCallback *)0x0);
    CUtlBuffer::CUtlBuffer(local_15c,local_164,local_160,8);
                    /* try { // try from 008153cc to 0081543f has its CatchHandler @ 00815471 */
    cVar1 = CChoreoScene::RestoreFromBinaryBuffer
                      (this,local_15c,local_124,(IChoreoStringPool *)&g_ChoreoStringPool);
    pCVar2 = this;
    if (cVar1 == '\0') {
      Warning("CSceneEntity::LoadScene: Unable to load binary scene \'%s\'\n",local_124);
      if (this != (CChoreoScene *)0x0) {
        CChoreoScene::~CChoreoScene(this);
        pCVar2 = (CChoreoScene *)0x0;
        operator_delete(this);
      }
    }
    else {
      CChoreoScene::SetPrintFunc(this,Scene_Printf);
      CChoreoScene::SetEventCallbackInterface(this,param_2);
    }
    if (local_164 != (uchar *)0x0) {
      operator_delete__(local_164);
    }
    CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)local_15c);
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return pCVar2;
  }
                    /* 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)