CCurveData::RestoreFromBuffer
0x00ba9b30 · 534 bytes · __cdecl
_ZN10CCurveData17RestoreFromBufferER10CUtlBufferP17IChoreoStringPool
Decompiled
undefined (2 params)
/* CCurveData::RestoreFromBuffer(CUtlBuffer&, IChoreoStringPool*) */
undefined4 CCurveData::RestoreFromBuffer(CUtlBuffer *param_1,IChoreoStringPool *param_2)
{
byte bVar1;
byte bVar2;
char cVar3;
int iVar4;
int iVar5;
float fVar6;
float local_30;
undefined4 local_24;
byte local_20;
undefined1 local_1f;
undefined1 local_1e;
undefined1 local_1d;
if (((byte)param_2[0x15] & 1) == 0) {
cVar3 = CUtlBuffer::CheckGet((CUtlBuffer *)param_2,1);
if (cVar3 == '\0') {
return 1;
}
bVar2 = *(byte *)(*(int *)param_2 + (*(int *)(param_2 + 0xc) - *(int *)(param_2 + 0x20)));
*(int *)(param_2 + 0xc) = *(int *)(param_2 + 0xc) + 1;
}
else {
local_20 = 0;
CUtlBuffer::Scanf((CUtlBuffer *)param_2,"%u",&local_20);
bVar2 = local_20;
}
if (bVar2 != 0) {
iVar5 = 0;
do {
if (((byte)param_2[0x15] & 1) == 0) {
cVar3 = CUtlBuffer::CheckGet((CUtlBuffer *)param_2,4);
local_30 = 0.0;
if (cVar3 == '\0') goto LAB_00ba9ba3;
iVar4 = *(int *)(param_2 + 0xc);
fVar6 = *(float *)(*(int *)param_2 + (iVar4 - *(int *)(param_2 + 0x20)));
local_24 = fVar6;
if (((byte)param_2[0x34] & 1) != 0) {
local_24._3_1_ = (byte)((uint)fVar6 >> 0x18);
local_20 = local_24._3_1_;
local_24._2_1_ = (undefined1)((uint)fVar6 >> 0x10);
local_1f = local_24._2_1_;
local_24._1_1_ = (undefined1)((uint)fVar6 >> 8);
local_1e = local_24._1_1_;
local_24._0_1_ = SUB41(fVar6,0);
local_1d = (undefined1)local_24;
_V_memcpy(&local_24,&local_20,4);
iVar4 = *(int *)(param_2 + 0xc);
}
*(int *)(param_2 + 0xc) = iVar4 + 4;
local_30 = local_24;
if (((byte)param_2[0x15] & 1) != 0) goto LAB_00ba9bb2;
LAB_00ba9cb8:
cVar3 = CUtlBuffer::CheckGet((CUtlBuffer *)param_2,1);
fVar6 = 0.0;
if (cVar3 != '\0') {
bVar1 = *(byte *)(*(int *)param_2 + (*(int *)(param_2 + 0xc) - *(int *)(param_2 + 0x20)));
*(int *)(param_2 + 0xc) = *(int *)(param_2 + 0xc) + 1;
fVar6 = ((float)bVar1 + 0.0) * 0.003921569;
}
}
else {
local_24 = 0.0;
CUtlBuffer::Scanf((CUtlBuffer *)param_2,"%f",&local_24);
local_30 = local_24;
LAB_00ba9ba3:
if (((byte)param_2[0x15] & 1) == 0) goto LAB_00ba9cb8;
LAB_00ba9bb2:
local_20 = 0;
CUtlBuffer::Scanf((CUtlBuffer *)param_2,"%u",&local_20);
fVar6 = ((float)local_20 + 0.0) * 0.003921569;
}
iVar5 = iVar5 + 1;
Add((CCurveData *)param_1,local_30,fVar6,false);
} while (iVar5 < (int)(uint)bVar2);
}
return 1;
}
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.