L L4D2node

CCurveData::FileSave

0x00bb0140 · 869 bytes · __thiscall

_ZN10CCurveData8FileSaveER10CUtlBufferiPKc

Decompiled

undefined (4 params)

/* CCurveData::FileSave(CUtlBuffer&, int, char const*) */

void __thiscall CCurveData::FileSave(CCurveData *this,CUtlBuffer *param_1,int param_2,char *param_3)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  float *pfVar4;
  uint uVar5;
  int iVar6;
  int in_GS_OFFSET;
  longdouble lVar7;
  double dVar8;
  char *pcVar9;
  char local_520 [256];
  char local_420 [1024];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar2 = GetCount(this);
  if (((0 < iVar2) || (cVar1 = IsEdgeActive(this,true), cVar1 != '\0')) ||
     (cVar1 = IsEdgeActive(this,false), cVar1 != '\0')) {
    pcVar9 = local_420;
    V_strncpy(pcVar9,param_3,0x400);
    cVar1 = IsEdgeActive(this,true);
    if ((cVar1 != '\0') || (cVar1 = IsEdgeActive(this,false), cVar1 != '\0')) {
      cVar1 = IsEdgeActive(this,true);
      if (cVar1 != '\0') {
        lVar7 = (longdouble)GetEdgeZeroValue(this,true);
        iVar6 = GetEdgeCurveType(this,true);
        uVar3 = Interpolator_NameForCurveType(iVar6,false);
        V_snprintf(local_520,0x100," leftedge %s %.3f",uVar3,SUB84((double)(float)lVar7,0),
                   (int)((ulonglong)(double)(float)lVar7 >> 0x20));
        V_strncat(pcVar9,local_520,0x400,-1);
      }
      cVar1 = IsEdgeActive(this,false);
      if (cVar1 != '\0') {
        lVar7 = (longdouble)GetEdgeZeroValue(this,false);
        iVar6 = GetEdgeCurveType(this,false);
        uVar3 = Interpolator_NameForCurveType(iVar6,false);
        V_snprintf(local_520,0x100," rightedge %s %.3f",uVar3,SUB84((double)(float)lVar7,0),
                   (int)((ulonglong)(double)(float)lVar7 >> 0x20));
        V_strncat(pcVar9,local_520,0x400,-1);
      }
    }
    iVar6 = 0;
    CChoreoScene::FilePrintf(param_1,param_2,"%s\n",pcVar9);
    CChoreoScene::FilePrintf(param_1,param_2,"{\n");
    dVar8 = (double)ZEXT48(pcVar9);
    if (0 < iVar2) {
      do {
        while( true ) {
          pfVar4 = (float *)Get(this,iVar6);
          uVar5 = (uint)*(byte *)((int)pfVar4 + 9) << 7 | (uint)(*(byte *)(pfVar4 + 2) >> 1);
          if (uVar5 != 0) break;
          iVar6 = iVar6 + 1;
          dVar8 = (double)pfVar4[1];
          CChoreoScene::FilePrintf
                    (param_1,param_2 + 1,"%.4f %.4f\n",SUB84(dVar8,0),
                     (int)((ulonglong)dVar8 >> 0x20),SUB84((double)*pfVar4,0),
                     (int)((ulonglong)(double)*pfVar4 >> 0x20));
          if (iVar6 == iVar2) goto LAB_00bb02f6;
        }
        iVar6 = iVar6 + 1;
        uVar3 = Interpolator_NameForCurveType(uVar5,false);
        dVar8 = (double)pfVar4[1];
        CChoreoScene::FilePrintf
                  (param_1,param_2 + 1,"%.4f %.4f \"%s\"\n",SUB84(dVar8,0),
                   (int)((ulonglong)dVar8 >> 0x20),SUB84((double)*pfVar4,0),
                   (int)((ulonglong)(double)*pfVar4 >> 0x20),uVar3);
      } while (iVar6 != iVar2);
    }
LAB_00bb02f6:
    CChoreoScene::FilePrintf(param_1,param_2,"}\n",SUB84(dVar8,0));
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)