CModelSoundsCache::Restore
0x00469690 · 497 bytes · __thiscall
_ZN17CModelSoundsCache7RestoreER10CUtlBuffer
Decompiled
undefined (2 params)
/* CModelSoundsCache::Restore(CUtlBuffer&) */
void __thiscall CModelSoundsCache::Restore(CModelSoundsCache *this,CUtlBuffer *param_1)
{
ushort uVar1;
int iVar2;
char cVar3;
ushort uVar4;
int iVar5;
ushort *puVar6;
int iVar7;
int in_GS_OFFSET;
ushort local_224;
undefined2 local_222;
char local_220 [512];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (((byte)param_1[0x15] & 1) == 0) {
cVar3 = CUtlBuffer::CheckGet(param_1,2);
if (cVar3 == '\0') goto LAB_004697af;
if (((byte)param_1[0x34] & 1) == 0) {
iVar7 = *(int *)(param_1 + 0xc);
uVar1 = *(ushort *)(*(int *)param_1 + (iVar7 - *(int *)(param_1 + 0x20)));
}
else {
puVar6 = (ushort *)((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (puVar6 == (ushort *)0x0) {
puVar6 = &local_224;
}
local_222 = local_224;
local_222 = CONCAT11((char)(local_224 >> 8),*(undefined1 *)((int)puVar6 + 1));
local_222 = CONCAT11((char)*puVar6,*(undefined1 *)((int)puVar6 + 1));
_V_memcpy(&local_224,&local_222,2);
iVar7 = *(int *)(param_1 + 0xc);
uVar1 = local_224;
}
*(int *)(param_1 + 0xc) = iVar7 + 2;
}
else {
local_224 = 0;
CUtlBuffer::Scanf(param_1,"%d",&local_224);
uVar1 = local_224;
}
if (uVar1 != 0) {
iVar7 = 0;
do {
CUtlBuffer::GetString(param_1,local_220,0x200);
iVar5 = (**(code **)(*soundemitterbase + 0x1c))(soundemitterbase,local_220);
if (iVar5 != -1) {
iVar2 = *(int *)(this + 0x10);
uVar4 = (ushort)iVar5;
if (iVar2 < 1) {
LAB_0046977d:
local_222 = uVar4;
CUtlVector<unsigned_short,CUtlMemory<unsigned_short,int>>::InsertBefore
((CUtlVector<unsigned_short,CUtlMemory<unsigned_short,int>> *)(this + 4),iVar2,
&local_222);
}
else if (uVar4 != **(ushort **)(this + 4)) {
iVar5 = 0;
do {
iVar5 = iVar5 + 1;
if (iVar5 == iVar2) goto LAB_0046977d;
} while (uVar4 != (*(ushort **)(this + 4))[iVar5]);
if (iVar5 == -1) goto LAB_0046977d;
}
}
iVar7 = iVar7 + 1;
} while (iVar7 < (int)(uint)uVar1);
}
LAB_004697af:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return;
}
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.