CResponseSystem::Precache
0x005b3b00 · 662 bytes · __thiscall
_ZN15CResponseSystem8PrecacheEv
Decompiled
undefined (1 param)
/* CResponseSystem::Precache() */
void __thiscall CResponseSystem::Precache(CResponseSystem *this)
{
int *piVar1;
int iVar2;
char *pcVar3;
int iVar4;
byte bVar5;
int iVar6;
int iVar7;
int iVar8;
int in_GS_OFFSET;
int local_2038;
char local_2020 [4096];
char local_1020 [4096];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
piVar1 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-makereslists");
local_2038 = 0;
if (*(short *)(this + 0x1e) != 0) {
do {
iVar6 = 0;
iVar7 = 0;
iVar8 = local_2038 * 0x20 + *(int *)(this + 0x10);
if (0 < *(int *)(iVar8 + 0x14)) {
do {
while( true ) {
iVar4 = *(int *)(iVar8 + 0xc) + iVar6;
bVar5 = *(byte *)(iVar4 + 0x2f) & 0x3f;
if (bVar5 != 1) break;
iVar7 = iVar7 + 1;
iVar6 = iVar6 + 0x50;
CBaseEntity::PrecacheScriptSound(*(char **)(iVar4 + 0x28));
if (*(int *)(iVar8 + 0x14) <= iVar7) goto LAB_005b3c8d;
}
if (bVar5 == 3) {
V_strncpy(local_2020,*(char **)(iVar4 + 0x28),0x1000);
pcVar3 = strstr(local_2020,"$gender");
if (pcVar3 == (char *)0x0) {
PrecacheInstancedScene(local_2020);
if (iVar2 != 0) {
(**(code **)(*(int *)(filesystem + 4) + 0x1c))(filesystem + 4,local_2020,0);
}
}
else {
*pcVar3 = '\0';
pcVar3 = pcVar3 + 7;
V_snprintf(local_1020,0x1000,"%smale%s",local_2020,pcVar3);
PrecacheInstancedScene(local_1020);
if (iVar2 != 0) {
(**(code **)(*(int *)(filesystem + 4) + 0x1c))(filesystem + 4,local_1020,0);
V_snprintf(local_1020,0x1000,"%sfemale%s",local_2020,pcVar3);
PrecacheInstancedScene(local_1020);
(**(code **)(*(int *)(filesystem + 4) + 0x1c))(filesystem + 4,local_1020,0);
}
else {
V_snprintf(local_1020,0x1000,"%sfemale%s",local_2020,pcVar3);
PrecacheInstancedScene(local_1020);
}
}
}
iVar7 = iVar7 + 1;
iVar6 = iVar6 + 0x50;
} while (iVar7 < *(int *)(iVar8 + 0x14));
}
LAB_005b3c8d:
local_2038 = local_2038 + 1;
} while (local_2038 < (int)(uint)*(ushort *)(this + 0x1e));
}
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.