L L4D2node

CChoreoChannel::ReconcileGestureTimes

0x00b9e3f0 · 626 bytes · __thiscall

_ZN14CChoreoChannel21ReconcileGestureTimesEv

Decompiled

undefined (1 param)

/* CChoreoChannel::ReconcileGestureTimes() */

void __thiscall CChoreoChannel::ReconcileGestureTimes(CChoreoChannel *this)

{
  int iVar1;
  CChoreoEvent *this_00;
  char cVar2;
  int iVar3;
  uint uVar4;
  CEventAbsoluteTag *this_01;
  CEventAbsoluteTag *this_02;
  int iVar5;
  CChoreoEvent *this_03;
  longdouble lVar6;
  longdouble lVar7;
  longdouble lVar8;
  float fVar9;
  CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
  *local_40;
  CChoreoEvent *local_3c;
  code *local_38;
  int local_34 [3];
  undefined2 local_28;
  short local_26;
  undefined2 local_24;
  undefined2 local_22;
  undefined4 local_20;
  
  local_24 = 0xffff;
  local_38 = ChoreEventStartTimeLessFunc;
  local_34[0] = 0;
  local_34[1] = 0;
  local_34[2] = 0;
  iVar1 = *(int *)(this + 0x90);
  local_28 = 0xffff;
  local_26 = 0;
  local_22 = 0xffff;
  local_20 = 0;
  if (0 < iVar1) {
    iVar5 = 0;
    do {
      while( true ) {
        if (iVar5 < *(int *)(this + 0x90)) {
          local_3c = *(CChoreoEvent **)(*(int *)(this + 0x84) + iVar5 * 4);
        }
        else {
          local_3c = (CChoreoEvent *)0x0;
        }
                    /* try { // try from 00b9e468 to 00b9e665 has its CatchHandler @ 00b9e678 */
        iVar3 = CChoreoEvent::GetType(local_3c);
        if (iVar3 == 6) break;
        iVar5 = iVar5 + 1;
        if (iVar5 == iVar1) goto LAB_00b9e4b0;
      }
      CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
      ::Insert((CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
                *)&local_38,&local_3c);
      iVar5 = iVar5 + 1;
    } while (iVar5 != iVar1);
LAB_00b9e4b0:
    if (local_26 != 0) {
      uVar4 = CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
              ::FirstInorder((CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
                              *)&local_38);
      uVar4 = uVar4 & 0xffff;
      if (uVar4 != 0xffff) {
        this_00 = *(CChoreoEvent **)(local_34[0] + uVar4 * 0xc + 8);
        while( true ) {
          this_03 = this_00;
          uVar4 = CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
                  ::NextInorder((CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
                                 *)&local_38,(ushort)uVar4);
          uVar4 = uVar4 & 0xffff;
          if (uVar4 == 0xffff) break;
          this_00 = *(CChoreoEvent **)(local_34[0] + uVar4 * 0xc + 8);
          if ((this_03 != (CChoreoEvent *)0x0) &&
             (cVar2 = CChoreoEvent::GetSyncToFollowingGesture(this_03), cVar2 != '\0')) {
            this_01 = (CEventAbsoluteTag *)CChoreoEvent::FindEntryTag(this_00,0);
            this_02 = (CEventAbsoluteTag *)CChoreoEvent::FindExitTag(this_03,0);
            if ((this_02 != (CEventAbsoluteTag *)0x0) && (this_01 != (CEventAbsoluteTag *)0x0)) {
              lVar6 = (longdouble)CEventAbsoluteTag::GetAbsoluteTime(this_01);
              lVar7 = (longdouble)(*(code *)**(undefined4 **)this_03)(this_03);
              lVar8 = (longdouble)CEventAbsoluteTag::GetPercentage(this_02);
              fVar9 = (1.0 - (float)lVar8) * (float)lVar7 + (float)lVar6;
              lVar7 = (longdouble)CChoreoEvent::GetStartTime(this_03);
              CChoreoEvent::RescaleGestureTimes(this_03,(float)lVar7,fVar9,true);
              CChoreoEvent::SetEndTime(this_03,fVar9);
              CEventAbsoluteTag::SetAbsoluteTime(this_02,(float)lVar6);
              CChoreoEvent::PreventTagOverlap(this_00);
              CChoreoEvent::PreventTagOverlap(this_03);
            }
          }
        }
        if (this_03 != (CChoreoEvent *)0x0) {
          CChoreoEvent::GetScene(this_03);
        }
      }
    }
  }
  local_40 = (CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
              *)&local_38;
  CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
  ::RemoveAll(local_40);
  local_24 = 0xffff;
  CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>::Purge
            ((CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short> *)local_34);
  local_22 = 0xffff;
  CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>::Purge
            ((CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short> *)local_34);
  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)