CChoreoScene::SaveToFile
0x00bb2d40 · 595 bytes · __thiscall
_ZN12CChoreoScene10SaveToFileEPKc
Decompiled
undefined (2 params)
/* CChoreoScene::SaveToFile(char const*) */
bool __thiscall CChoreoScene::SaveToFile(CChoreoScene *this,char *param_1)
{
CChoreoEvent *this_00;
CChoreoScene *this_01;
int iVar1;
int iVar2;
CUtlBuffer *pCVar3;
char *pcVar4;
CChoreoActor *pCVar5;
undefined4 local_54 [4];
undefined4 local_44;
pCVar5 = (CChoreoActor *)0x1;
CUtlBuffer::CUtlBuffer((CUtlBuffer *)local_54,0,0,1);
pcVar4 = "// Choreo version 1\n";
/* try { // try from 00bb2d85 to 00bb2f7c has its CatchHandler @ 00bb2f9b */
FilePrintf((CUtlBuffer *)local_54,0,"// Choreo version 1\n");
pCVar3 = (CUtlBuffer *)0x1;
MarkForSaveAll(this,true);
iVar2 = 0;
if (0 < *(int *)(this + 0x10)) {
do {
while( true ) {
this_00 = *(CChoreoEvent **)(*(int *)(this + 4) + iVar2 * 4);
iVar1 = CChoreoEvent::GetActor(this_00);
if ((iVar1 != 0) || (((byte)this_00[0x178] & 0x40) == 0)) break;
FileSaveEvent((CUtlBuffer *)local_54,0,this_00);
iVar2 = iVar2 + 1;
if (*(int *)(this + 0x10) <= iVar2) goto LAB_00bb2de0;
}
iVar2 = iVar2 + 1;
} while (iVar2 < *(int *)(this + 0x10));
}
LAB_00bb2de0:
iVar2 = 0;
if (0 < *(int *)(this + 0x24)) {
do {
while ((this_01 = *(CChoreoScene **)(*(int *)(this + 0x18) + iVar2 * 4),
this_01 == (CChoreoScene *)0x0 || (this_01[0x115] == (CChoreoScene)0x0))) {
iVar2 = iVar2 + 1;
if (*(int *)(this + 0x24) <= iVar2) goto LAB_00bb2e22;
}
FileSaveActor(this_01,pCVar3,(int)pcVar4,pCVar5);
iVar2 = iVar2 + 1;
} while (iVar2 < *(int *)(this + 0x24));
}
LAB_00bb2e22:
if (this[0xa8] != (CChoreoScene)0x0) {
FilePrintf((CUtlBuffer *)local_54,0,"mapname \"%s\"\n",this + 0xa8);
}
CCurveData::FileSave((CCurveData *)(this + 300),(CUtlBuffer *)local_54,0,"scene_ramp");
FileSaveScaleSettings((CUtlBuffer *)local_54,0,this);
FilePrintf((CUtlBuffer *)local_54,0,"fps %i\n",*(undefined4 *)(this + 0x128));
pcVar4 = "on";
if (((byte)this[0x20c] & 8) == 0) {
pcVar4 = "off";
}
FilePrintf((CUtlBuffer *)local_54,0,"snap %s\n",pcVar4);
pcVar4 = "on";
if (((byte)this[0x20c] & 2) == 0) {
pcVar4 = "off";
}
FilePrintf((CUtlBuffer *)local_54,0,"ignorePhonemes %s\n",pcVar4);
iVar2 = (**(code **)(*(int *)(g_pFullFileSystem + 4) + 8))
(g_pFullFileSystem + 4,param_1,&DAT_00bf9593,0);
if (iVar2 != 0) {
(**(code **)(*(int *)(g_pFullFileSystem + 4) + 4))
(g_pFullFileSystem + 4,local_54[0],local_44,iVar2);
(**(code **)(*(int *)(g_pFullFileSystem + 4) + 0xc))(g_pFullFileSystem + 4,iVar2);
}
CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)local_54);
return iVar2 != 0;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.