L L4D2node

CChoreoScene::FileSaveEvent

0x00bb0e00 · 2111 bytes · __regparm3

_ZN12CChoreoScene13FileSaveEventER10CUtlBufferiP12CChoreoEvent.part.7

Decompiled

undefined (3 params)

/* CChoreoScene::FileSaveEvent(CUtlBuffer&, int, CChoreoEvent*) [clone .part.7] */

void __regparm3 CChoreoScene::FileSaveEvent(CUtlBuffer *param_1,int param_2,CChoreoEvent *param_3)

{
  char cVar1;
  byte bVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  int iVar5;
  char *pcVar6;
  char *pcVar7;
  int iVar8;
  CEventRelativeTag *this;
  int iVar9;
  CFlexTimingTag *this_00;
  CEventAbsoluteTag *this_01;
  int iVar10;
  uint uVar11;
  longdouble lVar12;
  longdouble lVar13;
  double dVar14;
  double dVar15;
  float local_20 [4];
  
  uVar3 = CChoreoEvent::GetName(param_3);
  uVar4 = CChoreoEvent::GetType(param_3);
  uVar4 = CChoreoEvent::NameForType(uVar4);
  FilePrintf(param_1,param_2,"event %s \"%s\"\n",uVar4,uVar3);
  FilePrintf(param_1,param_2,"{\n");
  lVar12 = (longdouble)CChoreoEvent::GetStartTime(param_3);
  lVar13 = (longdouble)CChoreoEvent::GetEndTime(param_3);
  iVar5 = param_2 + 1;
  dVar14 = (double)(float)lVar13;
  dVar15 = (double)(float)lVar12;
  FilePrintf(param_1,iVar5,"time %f %f\n",SUB84(dVar15,0),(int)((ulonglong)dVar15 >> 0x20),
             SUB84(dVar14,0),(int)((ulonglong)dVar14 >> 0x20));
  uVar3 = (undefined4)((ulonglong)dVar15 >> 0x20);
  pcVar6 = (char *)CChoreoEvent::GetParameters(param_3);
  FilePrintf(param_1,iVar5,"param \"%s\"\n",pcVar6);
  pcVar7 = (char *)CChoreoEvent::GetParameters2(param_3);
  if (*pcVar7 == '\0') {
    pcVar7 = (char *)CChoreoEvent::GetParameters3(param_3);
    cVar1 = *pcVar7;
  }
  else {
    pcVar6 = (char *)CChoreoEvent::GetParameters2(param_3);
    FilePrintf(param_1,iVar5,"param2 \"%s\"\n",pcVar6);
    pcVar7 = (char *)CChoreoEvent::GetParameters3(param_3);
    cVar1 = *pcVar7;
  }
  if (cVar1 != '\0') {
    pcVar6 = (char *)CChoreoEvent::GetParameters3(param_3);
    FilePrintf(param_1,iVar5,"param3 \"%s\"\n",pcVar6);
  }
  iVar8 = CCurveData::GetCount((CCurveData *)(param_3 + 0x5c));
  if (0 < iVar8) {
    pcVar6 = "event_ramp";
    CCurveData::FileSave((CCurveData *)(param_3 + 0x5c),param_1,iVar5,"event_ramp");
  }
  iVar8 = CChoreoEvent::GetPitch(param_3);
  if (iVar8 != 0) {
    pcVar6 = (char *)CChoreoEvent::GetPitch(param_3);
    FilePrintf(param_1,iVar5,"pitch \"%i\"\n",pcVar6);
  }
  iVar8 = CChoreoEvent::GetYaw(param_3);
  if (iVar8 != 0) {
    pcVar6 = (char *)CChoreoEvent::GetYaw(param_3);
    FilePrintf(param_1,iVar5,"yaw \"%i\"\n",pcVar6);
  }
  cVar1 = CChoreoEvent::IsResumeCondition(param_3);
  if (cVar1 != '\0') {
    FilePrintf(param_1,iVar5,"resumecondition\n",pcVar6);
  }
  cVar1 = CChoreoEvent::IsLockBodyFacing(param_3);
  if (cVar1 != '\0') {
    FilePrintf(param_1,iVar5,"lockbodyfacing\n");
  }
  lVar12 = (longdouble)CChoreoEvent::GetDistanceToTarget(param_3);
  dVar15 = (double)CONCAT44(uVar3,pcVar6);
  if (0.0 < (float)lVar12) {
    lVar12 = (longdouble)CChoreoEvent::GetDistanceToTarget(param_3);
    dVar15 = (double)(float)lVar12;
    FilePrintf(param_1,iVar5,"distancetotarget %.2f\n",SUB84(dVar15,0),
               (int)((ulonglong)dVar15 >> 0x20));
  }
  cVar1 = CChoreoEvent::GetForceShortMovement(param_3);
  if (cVar1 != '\0') {
    FilePrintf(param_1,iVar5,"forceshortmovement\n",SUB84(dVar15,0),(int)((ulonglong)dVar15 >> 0x20)
              );
  }
  cVar1 = CChoreoEvent::GetSyncToFollowingGesture(param_3);
  if (cVar1 != '\0') {
    FilePrintf(param_1,iVar5,"synctofollowinggesture\n");
  }
  cVar1 = CChoreoEvent::GetActive(param_3);
  if (cVar1 == '\0') {
    FilePrintf(param_1,iVar5,"active 0\n");
  }
  cVar1 = CChoreoEvent::GetPlayOverScript(param_3);
  if (cVar1 != '\0') {
    FilePrintf(param_1,iVar5,"playoverscript\n");
  }
  cVar1 = CChoreoEvent::IsFixedLength(param_3);
  if (cVar1 != '\0') {
    FilePrintf(param_1,iVar5,"fixedlength\n");
  }
  iVar8 = CChoreoEvent::GetNumRelativeTags(param_3);
  if (0 < iVar8) {
    FilePrintf(param_1,iVar5,"tags\n");
    FilePrintf(param_1,iVar5,"{\n");
    uVar4 = (undefined4)((ulonglong)dVar14 >> 0x20);
    uVar3 = SUB84(dVar15,0);
    dVar15 = (double)CONCAT44(SUB84(dVar14,0),(int)((ulonglong)dVar15 >> 0x20));
    iVar8 = 0;
    while( true ) {
      iVar9 = CChoreoEvent::GetNumRelativeTags(param_3);
      if (iVar9 <= iVar8) break;
      this = (CEventRelativeTag *)CChoreoEvent::GetRelativeTag(param_3,iVar8);
      lVar12 = (longdouble)CEventRelativeTag::GetPercentage(this);
      uVar3 = CEventRelativeTag::GetName(this);
      dVar15 = (double)(float)lVar12;
      FilePrintf(param_1,param_2 + 2,"\"%s\" %f\n",uVar3,SUB84(dVar15,0),
                 (int)((ulonglong)dVar15 >> 0x20));
      iVar8 = iVar8 + 1;
    }
    FilePrintf(param_1,iVar5,"}\n",uVar3,SUB84(dVar15,0),(int)((ulonglong)dVar15 >> 0x20));
    dVar14 = (double)CONCAT44(uVar4,(int)((ulonglong)dVar15 >> 0x20));
    dVar15 = (double)CONCAT44(SUB84(dVar15,0),uVar3);
  }
  iVar8 = CChoreoEvent::GetNumTimingTags(param_3);
  if (0 < iVar8) {
    FilePrintf(param_1,iVar5,"flextimingtags\n");
    FilePrintf(param_1,iVar5,"{\n");
    uVar11 = (uint)((ulonglong)dVar14 >> 0x20);
    uVar3 = SUB84(dVar15,0);
    dVar15 = (double)CONCAT44(SUB84(dVar14,0),(int)((ulonglong)dVar15 >> 0x20));
    iVar8 = 0;
    while( true ) {
      iVar9 = CChoreoEvent::GetNumTimingTags(param_3);
      if (iVar9 <= iVar8) break;
      this_00 = (CFlexTimingTag *)CChoreoEvent::GetTimingTag(param_3,iVar8);
      bVar2 = CFlexTimingTag::GetLocked(this_00);
      lVar12 = (longdouble)CEventRelativeTag::GetPercentage((CEventRelativeTag *)this_00);
      uVar3 = CEventRelativeTag::GetName((CEventRelativeTag *)this_00);
      uVar11 = (uint)bVar2;
      dVar15 = (double)(float)lVar12;
      FilePrintf(param_1,param_2 + 2,"\"%s\" %f %i\n",uVar3,SUB84(dVar15,0),
                 (int)((ulonglong)dVar15 >> 0x20),uVar11);
      iVar8 = iVar8 + 1;
    }
    FilePrintf(param_1,iVar5,"}\n",uVar3,SUB84(dVar15,0),(int)((ulonglong)dVar15 >> 0x20),uVar11);
    dVar14 = (double)((ulonglong)dVar15 >> 0x20);
    dVar15 = (double)CONCAT44(SUB84(dVar15,0),uVar3);
  }
  iVar8 = 0;
  do {
    iVar9 = CChoreoEvent::GetNumAbsoluteTags(param_3,iVar8);
    uVar3 = (undefined4)((ulonglong)dVar15 >> 0x20);
    if (0 < iVar9) {
      uVar4 = CChoreoEvent::NameForAbsoluteTagType(iVar8);
      FilePrintf(param_1,iVar5,"absolutetags %s\n",uVar4);
      FilePrintf(param_1,iVar5,"{\n");
      dVar15 = (double)CONCAT44(SUB84(dVar14,0),uVar3);
      iVar9 = 0;
      while( true ) {
        iVar10 = CChoreoEvent::GetNumAbsoluteTags(param_3,iVar8);
        if (iVar10 <= iVar9) break;
        this_01 = (CEventAbsoluteTag *)CChoreoEvent::GetAbsoluteTag(param_3,iVar8,iVar9);
        lVar12 = (longdouble)CEventAbsoluteTag::GetPercentage(this_01);
        uVar4 = CEventAbsoluteTag::GetName(this_01);
        dVar15 = (double)(float)lVar12;
        FilePrintf(param_1,param_2 + 2,"\"%s\" %f\n",uVar4,SUB84(dVar15,0),
                   (int)((ulonglong)dVar15 >> 0x20));
        iVar9 = iVar9 + 1;
      }
      FilePrintf(param_1,iVar5,"}\n",uVar4,SUB84(dVar15,0),(int)((ulonglong)dVar15 >> 0x20));
      dVar14 = (double)((ulonglong)dVar15 >> 0x20);
      dVar15 = (double)CONCAT44(SUB84(dVar15,0),uVar4);
    }
    iVar8 = iVar8 + 1;
  } while (iVar8 != 2);
  iVar8 = CChoreoEvent::GetType(param_3);
  if ((iVar8 == 6) &&
     (cVar1 = CChoreoEvent::GetGestureSequenceDuration(param_3,local_20), cVar1 != '\0')) {
    dVar15 = (double)local_20[0];
    FilePrintf(param_1,iVar5,"sequenceduration %f\n",SUB84(dVar15,0),
               (int)((ulonglong)dVar15 >> 0x20));
  }
  cVar1 = CChoreoEvent::IsUsingRelativeTag(param_3);
  if (cVar1 != '\0') {
    uVar3 = CChoreoEvent::GetRelativeWavName(param_3);
    uVar11 = CChoreoEvent::GetRelativeTagName(param_3);
    FilePrintf(param_1,iVar5,"relativetag \"%s\" \"%s\"\n",uVar11,uVar3);
    dVar15 = (double)(ulonglong)uVar11;
  }
  iVar8 = CChoreoEvent::GetNumFlexAnimationTracks(param_3);
  if (0 < iVar8) {
    FileSaveFlexAnimations(param_1,param_2,param_3);
  }
  iVar8 = CChoreoEvent::GetType(param_3);
  if (iVar8 == 0xc) {
    uVar3 = CChoreoEvent::GetLoopCount(param_3);
    FilePrintf(param_1,iVar5,"loopcount \"%i\"\n",uVar3);
    iVar8 = CChoreoEvent::GetType(param_3);
  }
  else {
    iVar8 = CChoreoEvent::GetType(param_3);
    uVar3 = SUB84(dVar15,0);
  }
  if (iVar8 == 5) {
    uVar3 = CChoreoEvent::GetCloseCaptionType(param_3);
    uVar3 = CChoreoEvent::NameForCCType(uVar3);
    FilePrintf(param_1,iVar5,"cctype \"%s\"\n",uVar3);
    uVar3 = CChoreoEvent::GetCloseCaptionToken(param_3);
    FilePrintf(param_1,iVar5,"cctoken \"%s\"\n",uVar3);
    iVar8 = CChoreoEvent::GetCloseCaptionType(param_3);
    if ((iVar8 != 2) && (cVar1 = CChoreoEvent::IsUsingCombinedFile(param_3), cVar1 != '\0')) {
      FilePrintf(param_1,iVar5,"cc_usingcombinedfile\n",uVar3);
    }
    cVar1 = CChoreoEvent::IsCombinedUsingGenderToken(param_3);
    if (cVar1 != '\0') {
      FilePrintf(param_1,iVar5,"cc_combinedusesgender\n",uVar3);
    }
    cVar1 = CChoreoEvent::IsSuppressingCaptionAttenuation(param_3);
    if (cVar1 != '\0') {
      FilePrintf(param_1,iVar5,"cc_noattenuate\n");
    }
  }
  FilePrintf(param_1,param_2,"}\n",uVar3);
  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)