CUtlCachedFileData<CModelSoundsCache>::Init
0x00616830 · 402 bytes · __thiscall
_ZN18CUtlCachedFileDataI17CModelSoundsCacheE4InitEv.part.431
Decompiled
undefined (1 param)
/* CUtlCachedFileData<CModelSoundsCache>::Init() [clone .part.431] */
byte __thiscall
CUtlCachedFileData<CModelSoundsCache>::Init(CUtlCachedFileData<CModelSoundsCache> *this)
{
CUtlString *this_00;
code *pcVar1;
byte bVar2;
byte bVar3;
CUtlCachedFileData<CModelSoundsCache> *in_EAX;
int iVar4;
undefined4 uVar5;
long lVar6;
bool local_21;
void *local_20 [4];
this_00 = (CUtlString *)(in_EAX + 0x34);
in_EAX[100] = (CUtlCachedFileData<CModelSoundsCache>)((byte)in_EAX[100] | 0x10);
iVar4 = CUtlString::Length(this_00);
if (iVar4 == 0) {
Error("CUtlCachedFileData: Can\'t Init, no repository file specified.");
return 0;
}
uVar5 = 0;
if (*(code **)(in_EAX + 0x58) != (code *)0x0) {
uVar5 = (**(code **)(in_EAX + 0x58))();
}
*(undefined4 *)(in_EAX + 0x5c) = uVar5;
pcVar1 = *(code **)(g_pFullFileSystem[1] + 8);
uVar5 = CUtlString::Get(this_00);
local_20[0] = (void *)(*pcVar1)(g_pFullFileSystem + 1,uVar5,"rb",&DAT_00c146f4);
if (local_20[0] == (void *)0x0) {
bVar2 = (byte)in_EAX[100] >> 1;
bVar3 = bVar2 & 1;
if ((bVar2 & 1) == 0) {
in_EAX[100] = (CUtlCachedFileData<CModelSoundsCache>)((byte)in_EAX[100] | 8);
return 1;
}
}
else {
pcVar1 = *(code **)(g_pFullFileSystem[1] + 0x34);
uVar5 = CUtlString::Get(this_00);
lVar6 = (*pcVar1)(g_pFullFileSystem + 1,uVar5,&DAT_00c146f4);
iVar4 = (**(code **)(g_pFullFileSystem[1] + 0x18))(g_pFullFileSystem + 1,local_20[0]);
local_21 = false;
if (iVar4 < 0x100001) {
InitSmallBuffer(in_EAX,local_20,iVar4,&local_21);
}
else {
InitLargeBuffer(in_EAX,local_20,&local_21);
}
if ((local_21 != false) && (((byte)in_EAX[100] & 2) == 0)) {
pcVar1 = *(code **)(*g_pFullFileSystem + 0x40);
uVar5 = CUtlString::Get(this_00);
(*pcVar1)(g_pFullFileSystem,uVar5,&DAT_00c146f4);
in_EAX[100] = (CUtlCachedFileData<CModelSoundsCache>)((byte)in_EAX[100] | 8);
}
CheckDiskInfo(in_EAX,false,lVar6);
bVar3 = 1;
}
return bVar3;
}
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.