L L4D2node

CScriptSpeechQueue::PerFrameDispatch

0x005dad30 · 426 bytes · __thiscall

_ZN18CScriptSpeechQueue16PerFrameDispatchEv

Decompiled

undefined (1 param)

/* CScriptSpeechQueue::PerFrameDispatch() */

void __thiscall CScriptSpeechQueue::PerFrameDispatch(CScriptSpeechQueue *this)

{
  CQueuedScriptEvent *pCVar1;
  uint uVar2;
  CQueuedScriptEvent *this_00;
  void *pvVar3;
  undefined *puVar4;
  int iVar5;
  void *local_38;
  void *local_34;
  undefined4 local_30;
  undefined2 local_2c;
  ushort local_2a;
  void *local_28;
  undefined4 local_24;
  undefined2 local_20;
  ushort local_1e;
  
  pCVar1 = *(CQueuedScriptEvent **)(this + 0xc);
  while (this_00 = pCVar1, this_00 != (CQueuedScriptEvent *)0x0) {
    pCVar1 = *(CQueuedScriptEvent **)(this_00 + 0x34);
    if (*(float *)(this_00 + 8) <= *(float *)(gpGlobals + 0xc)) {
      CSpeechScriptBridge::AICriteriaSetToScript
                ((CSpeechScriptBridge *)&local_38,(AI_CriteriaSet *)(this_00 + 0x10));
      pvVar3 = local_38;
      iVar5 = *(int *)this_00;
      if (iVar5 != 0) {
        uVar2 = *(uint *)(this_00 + 0xc);
        if (((uVar2 == 0xffffffff) ||
            (puVar4 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar4 == (undefined *)0xfffffffc)) ||
           (*(uint *)(puVar4 + 8) != uVar2 >> 0xc)) {
          local_34 = (void *)0x0;
        }
        else if (*(CBaseEntity **)(puVar4 + 4) == (CBaseEntity *)0x0) {
          local_34 = (void *)0x0;
        }
        else {
                    /* try { // try from 005daece to 005daed2 has its CatchHandler @ 005daf50 */
          local_34 = (void *)CBaseEntity::GetScriptInstance(*(CBaseEntity **)(puVar4 + 4));
          iVar5 = *(int *)this_00;
        }
        local_20 = 0x20;
        local_2a = 0;
        local_1e = 0;
        local_30 = 0;
        local_28 = pvVar3;
        local_2c = 0x20;
        local_24 = 0;
                    /* try { // try from 005dae35 to 005dae37 has its CatchHandler @ 005daeda */
        (**(code **)(*g_pScriptVM + 0x50))
                  (g_pScriptVM,iVar5,&local_34,2,0,*(undefined4 *)(this_00 + 4),1);
        if ((local_1e & 1) != 0) {
          free(local_28);
          local_1e = local_1e & 0xfffe;
        }
        local_28 = (void *)0x0;
        local_24 = 0;
        local_20 = 0;
        if ((local_2a & 1) != 0) {
          free(local_34);
        }
      }
      CUtlLinkedList<CScriptSpeechQueue::CQueuedScriptEvent,int,true,int,CUtlFixedMemory<UtlLinkedListElem_t<CScriptSpeechQueue::CQueuedScriptEvent,int>>>
      ::Unlink((CUtlLinkedList<CScriptSpeechQueue::CQueuedScriptEvent,int,true,int,CUtlFixedMemory<UtlLinkedListElem_t<CScriptSpeechQueue::CQueuedScriptEvent,int>>>
                *)this,(int)this_00);
      CQueuedScriptEvent::~CQueuedScriptEvent(this_00);
      *(undefined4 *)(this_00 + 0x34) = *(undefined4 *)(this + 0x14);
      *(CQueuedScriptEvent **)(this + 0x14) = this_00;
      if (local_38 != (void *)0x0) {
        (**(code **)(*g_pScriptVM + 0x30))(g_pScriptVM,local_38);
      }
    }
  }
  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)