L L4D2node

CSceneEntity::BuildSortedSpeakEventSoundsPrefetchList

0x00818a20 · 546 bytes · __thiscall

_ZN12CSceneEntity39BuildSortedSpeakEventSoundsPrefetchListEP12CChoreoSceneR15CUtlSymbolTableR10CUtlRBTreeINS_17SpeakEventSound_tEtPFbRKS5_S7_E10CUtlMemoryI15UtlRBTreeNode_tIS5_tEtEEf

Decompiled

undefined (5 params)

/* CSceneEntity::BuildSortedSpeakEventSoundsPrefetchList(CChoreoScene*, CUtlSymbolTable&,
   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> >&,
   float) */

void __thiscall
CSceneEntity::BuildSortedSpeakEventSoundsPrefetchList
          (CSceneEntity *this,CChoreoScene *param_1,CUtlSymbolTable *param_2,CUtlRBTree *param_3,
          float param_4)

{
  char cVar1;
  int iVar2;
  CChoreoEvent *this_00;
  char *pcVar3;
  CChoreoScene *this_01;
  CBasePlayer *pCVar4;
  int iVar5;
  int in_GS_OFFSET;
  longdouble lVar6;
  undefined2 local_6a;
  undefined2 local_68 [2];
  float local_64;
  char local_60 [64];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  for (iVar5 = 0; iVar2 = CChoreoScene::GetNumEvents(param_1), iVar5 < iVar2; iVar5 = iVar5 + 1) {
    this_00 = (CChoreoEvent *)CChoreoScene::GetEvent(param_1,iVar5);
    if (this_00 != (CChoreoEvent *)0x0) {
      iVar2 = CChoreoEvent::GetType(this_00);
      if (iVar2 == 5) {
        pcVar3 = (char *)CChoreoEvent::GetParameters(this_00);
        V_strncpy(local_60,pcVar3,0x40);
        iVar2 = CChoreoEvent::GetCloseCaptionType(this_00);
        if (iVar2 == 0) {
          CChoreoEvent::GetPlaybackCloseCaptionToken(this_00,local_60,0x40);
          iVar2 = *(int *)(gpGlobals + 0x14);
        }
        else {
          iVar2 = *(int *)(gpGlobals + 0x14);
        }
        if (((iVar2 != 1) ||
            (pCVar4 = (CBasePlayer *)UTIL_GetLocalPlayer(), pCVar4 == (CBasePlayer *)0x0)) ||
           (cVar1 = GetSoundNameForPlayer(this,this_00,pCVar4,local_60,0x40), cVar1 != '\0')) {
          local_68[0] = 0xffff;
          CUtlSymbolTable::AddString((char *)&local_6a);
          local_68[0] = local_6a;
          lVar6 = (longdouble)CChoreoEvent::GetStartTime(this_00);
          local_64 = (float)lVar6 + param_4;
          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>>
          ::Insert((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>>
                    *)param_3,(SpeakEventSound_t *)local_68);
        }
      }
      else if (((iVar2 == 0xb) && (cVar1 = CChoreoScene::IsSubScene(param_1), cVar1 == '\0')) &&
              (iVar2 = CChoreoEvent::GetSubScene(this_00), iVar2 == 0)) {
        pcVar3 = (char *)CChoreoEvent::GetParameters(this_00);
        this_01 = (CChoreoScene *)LoadScene(pcVar3,(IChoreoEventCallback *)(this + 0x440));
        CChoreoScene::SetSubScene(this_01,true);
        CChoreoEvent::SetSubScene(this_00,this_01);
        lVar6 = (longdouble)CChoreoEvent::GetStartTime(this_00);
        BuildSortedSpeakEventSoundsPrefetchList(this,this_01,param_2,param_3,(float)lVar6);
      }
    }
  }
  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)