CChoreoActor::RestoreFromBuffer
0x00b9d3d0 · 817 bytes · __thiscall
_ZN12CChoreoActor17RestoreFromBufferER10CUtlBufferP12CChoreoSceneP17IChoreoStringPool
Decompiled
undefined (4 params)
/* CChoreoActor::RestoreFromBuffer(CUtlBuffer&, CChoreoScene*, IChoreoStringPool*) */
undefined4 __thiscall
CChoreoActor::RestoreFromBuffer
(CChoreoActor *this,CUtlBuffer *param_1,CChoreoScene *param_2,IChoreoStringPool *param_3)
{
byte bVar1;
ushort uVar2;
code *pcVar3;
undefined2 uVar4;
char cVar5;
CChoreoChannel *this_00;
undefined4 uVar6;
int iVar7;
ushort *puVar8;
int iVar9;
int in_GS_OFFSET;
CChoreoActor CVar10;
ushort local_126;
undefined4 local_124;
char local_120 [256];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
pcVar3 = *(code **)(*(int *)param_3 + 4);
if (((byte)param_1[0x15] & 1) == 0) {
cVar5 = CUtlBuffer::CheckGet(param_1,2);
iVar9 = 0;
if (cVar5 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
iVar7 = *(int *)(param_1 + 0xc);
uVar2 = *(ushort *)(*(int *)param_1 + (iVar7 - *(int *)(param_1 + 0x20)));
}
else {
puVar8 = (ushort *)((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (puVar8 == (ushort *)0x0) {
puVar8 = &local_126;
}
uVar4 = local_124._2_2_;
local_124 = (CChoreoChannel *)CONCAT22(local_124._2_2_,local_126);
local_124 = (CChoreoChannel *)CONCAT31(local_124._1_3_,*(undefined1 *)((int)puVar8 + 1));
local_124 = (CChoreoChannel *)
CONCAT22(uVar4,CONCAT11((char)*puVar8,*(undefined1 *)((int)puVar8 + 1)));
_V_memcpy(&local_126,&local_124,2);
iVar7 = *(int *)(param_1 + 0xc);
uVar2 = local_126;
}
iVar9 = (int)(short)uVar2;
*(int *)(param_1 + 0xc) = iVar7 + 2;
}
}
else {
local_126 = 0;
CUtlBuffer::Scanf(param_1,"%d",&local_126);
iVar9 = (int)(short)local_126;
}
(*pcVar3)(param_3,iVar9,local_120,0x100);
V_strncpy((char *)this,local_120,0x80);
if (((byte)param_1[0x15] & 1) == 0) {
cVar5 = CUtlBuffer::CheckGet(param_1,1);
if (cVar5 == '\0') goto LAB_00b9d5a8;
bVar1 = *(byte *)(*(int *)param_1 + (*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)));
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
}
else {
local_124 = (CChoreoChannel *)((uint)local_124 & 0xffffff00);
CUtlBuffer::Scanf(param_1,"%u",&local_124);
bVar1 = (byte)local_124;
}
if (bVar1 != 0) {
iVar9 = 1;
do {
this_00 = (CChoreoChannel *)CChoreoScene::AllocChannel(param_2);
uVar6 = CChoreoChannel::RestoreFromBuffer(this_00,param_1,param_2,this,param_3);
if ((char)uVar6 == '\0') goto LAB_00b9d56d;
iVar9 = iVar9 + 1;
local_124 = this_00;
CUtlVector<CChoreoChannel*,CUtlMemory<CChoreoChannel*,int>>::InsertBefore
((CUtlVector<CChoreoChannel*,CUtlMemory<CChoreoChannel*,int>> *)(this + 0x100),
*(int *)(this + 0x10c),(CChoreoChannel **)&local_124);
CChoreoChannel::SetActor(this_00,this);
} while (iVar9 != bVar1 + 1);
}
LAB_00b9d5a8:
if (((byte)param_1[0x15] & 1) == 0) {
cVar5 = CUtlBuffer::CheckGet(param_1,1);
CVar10 = (CChoreoActor)0x0;
if (cVar5 != '\0') {
cVar5 = *(char *)(*(int *)param_1 + (*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)));
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
CVar10 = (CChoreoActor)(cVar5 == '\x01');
}
}
else {
local_126 = local_126 & 0xff00;
CUtlBuffer::Scanf(param_1,"%c",&local_126);
CVar10 = (CChoreoActor)((char)local_126 == '\x01');
}
this[0x114] = CVar10;
uVar6 = 1;
LAB_00b9d56d:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return uVar6;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.