L L4D2node

CBaseFlex::HandleStartSequenceSceneEvent

0x00624ae0 · 781 bytes · __thiscall

_ZN9CBaseFlex29HandleStartSequenceSceneEventEP15CSceneEventInfoP12CChoreoSceneP12CChoreoEventP12CChoreoActor

Decompiled

undefined (5 params)

/* CBaseFlex::HandleStartSequenceSceneEvent(CSceneEventInfo*, CChoreoScene*, CChoreoEvent*,
   CChoreoActor*) */

undefined4 __thiscall
CBaseFlex::HandleStartSequenceSceneEvent
          (CBaseFlex *this,CSceneEventInfo *param_1,CChoreoScene *param_2,CChoreoEvent *param_3,
          CChoreoActor *param_4)

{
  char cVar1;
  char *pcVar2;
  int iVar3;
  undefined4 uVar4;
  CChoreoChannel *pCVar5;
  int iVar6;
  uint uVar7;
  undefined4 uVar8;
  undefined4 uVar9;
  CStudioHdr *pCVar10;
  undefined1 *puVar11;
  CStudioHdr *pCVar12;
  longdouble lVar13;
  longdouble lVar14;
  longdouble lVar15;
  float fVar16;
  
  pcVar2 = (char *)CChoreoEvent::GetParameters(param_3);
  iVar3 = CBaseAnimating::LookupSequence((CBaseAnimating *)this,pcVar2);
  *(undefined4 *)(param_1 + 0x14) = 0xffffffff;
  *(int *)(param_1 + 0x1c) = iVar3;
  if (iVar3 < 0) {
    uVar4 = CChoreoEvent::GetParameters(param_3);
    uVar8 = CChoreoActor::GetName(param_4);
    puVar11 = &DAT_00d539c2;
    if (*(undefined1 **)(this + 0x154) != (undefined1 *)0x0) {
      puVar11 = *(undefined1 **)(this + 0x154);
    }
    Warning("CSceneEntity %s :\"%s\" unable to find sequence \"%s\"\n",puVar11,uVar8,uVar4);
    return 0;
  }
  Warning("Scene sequences are unavailable in Left4Dead.\n");
  uVar4 = CChoreoEvent::GetPlayOverScript(param_3);
  if ((char)uVar4 == '\0') {
    uVar8 = CChoreoEvent::GetParameters(param_3);
    uVar9 = CChoreoActor::GetName(param_4);
    puVar11 = &DAT_00d539c2;
    if (*(undefined1 **)(this + 0x154) != (undefined1 *)0x0) {
      puVar11 = *(undefined1 **)(this + 0x154);
    }
    Warning("CSceneEntity %s :\"%s\" failed to start sequence \"%s\"\n",puVar11,uVar9,uVar8);
    return uVar4;
  }
  pCVar5 = (CChoreoChannel *)CChoreoEvent::GetChannel(param_3);
  iVar3 = CChoreoActor::FindChannelIndex(param_4,pCVar5);
  *(int *)(param_1 + 0x18) = iVar3;
  iVar6 = GetScenePriority(this,param_2);
  iVar3 = CBaseAnimatingOverlay::AddLayeredSequence
                    ((CBaseAnimatingOverlay *)this,*(int *)(param_1 + 0x1c),iVar3 + iVar6);
  *(int *)(param_1 + 0x14) = iVar3;
  CBaseAnimatingOverlay::SetLayerNoRestore((CBaseAnimatingOverlay *)this,iVar3,true);
  CBaseAnimatingOverlay::SetLayerWeight((CBaseAnimatingOverlay *)this,*(int *)(param_1 + 0x14),0.0);
  pCVar10 = *(CStudioHdr **)(this + 0x13e0);
  iVar3 = *(int *)(param_1 + 0x1c);
  if (pCVar10 == (CStudioHdr *)0x0) {
    iVar6 = CBaseEntity::GetModel((CBaseEntity *)this);
    if (iVar6 == 0) {
      pCVar10 = *(CStudioHdr **)(this + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr((CBaseAnimating *)this);
      pCVar10 = *(CStudioHdr **)(this + 0x13e0);
    }
    pCVar12 = (CStudioHdr *)0x0;
    if (pCVar10 != (CStudioHdr *)0x0) goto LAB_00624bbf;
  }
  else {
LAB_00624bbf:
    pCVar12 = (CStudioHdr *)0x0;
    if (*(int *)pCVar10 != 0) {
      pCVar12 = pCVar10;
    }
  }
  uVar7 = GetSequenceFlags(pCVar12,iVar3);
  if ((uVar7 & 1) != 0) {
    CBaseAnimatingOverlay::SetLayerPlaybackRate
              ((CBaseAnimatingOverlay *)this,*(int *)(param_1 + 0x14),1.0);
    uVar8 = (**(code **)(*(int *)this + 0x154))(this);
    cVar1 = (char)uVar8;
    goto joined_r0x00624d6c;
  }
  lVar13 = (longdouble)CChoreoScene::GetTime(param_2);
  lVar14 = (longdouble)CChoreoEvent::GetStartTime(param_3);
  pCVar10 = *(CStudioHdr **)(this + 0x13e0);
  iVar3 = *(int *)(param_1 + 0x1c);
  if (pCVar10 == (CStudioHdr *)0x0) {
    iVar6 = CBaseEntity::GetModel((CBaseEntity *)this);
    if (iVar6 == 0) {
      pCVar10 = *(CStudioHdr **)(this + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr((CBaseAnimating *)this);
      pCVar10 = *(CStudioHdr **)(this + 0x13e0);
    }
    pCVar12 = (CStudioHdr *)0x0;
    if (pCVar10 != (CStudioHdr *)0x0) goto LAB_00624c1b;
  }
  else {
LAB_00624c1b:
    pCVar12 = (CStudioHdr *)0x0;
    if (*(int *)pCVar10 != 0) {
      pCVar12 = pCVar10;
    }
  }
  lVar15 = (longdouble)CBaseAnimating::SequenceDuration((CBaseAnimating *)this,pCVar12,iVar3);
  fVar16 = ((float)lVar13 - (float)lVar14) / (float)lVar15;
  fVar16 = fVar16 - (float)(int)fVar16;
  CBaseAnimatingOverlay::SetLayerCycle
            ((CBaseAnimatingOverlay *)this,*(int *)(param_1 + 0x14),fVar16,fVar16);
  CBaseAnimatingOverlay::SetLayerPlaybackRate
            ((CBaseAnimatingOverlay *)this,*(int *)(param_1 + 0x14),0.0);
  uVar8 = (**(code **)(*(int *)this + 0x154))(this);
  cVar1 = (char)uVar8;
joined_r0x00624d6c:
  if (cVar1 == '\0') {
    *(undefined4 *)(param_1 + 0x24) = 0x3f800000;
    return uVar4;
  }
  *(undefined4 *)(param_1 + 0x24) = 0;
  return uVar8;
}

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)