CChoreoEvent::ComputeCombinedBaseFileName
0x00ba6c80 · 441 bytes · __thiscall
_ZN12CChoreoEvent27ComputeCombinedBaseFileNameEPcib
Decompiled
undefined (4 params)
/* CChoreoEvent::ComputeCombinedBaseFileName(char*, int, bool) */
undefined4 __thiscall
CChoreoEvent::ComputeCombinedBaseFileName(CChoreoEvent *this,char *param_1,int param_2,bool param_3)
{
undefined4 uVar1;
char *pcVar2;
int iVar3;
char cVar4;
char *pcVar5;
int in_GS_OFFSET;
char local_260 [64];
char local_220 [512];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if ((((this[4] == (CChoreoEvent)0x5) && (this[5] == (CChoreoEvent)0x0)) &&
(*(int *)(this + 0x150) != 0)) && (*(int *)(this + 0x128) != 0)) {
pcVar2 = (char *)CUtlString::Get((CUtlString *)(this + 0x13c));
cVar4 = *pcVar2;
pcVar5 = local_260;
if (cVar4 != '\0') {
do {
iVar3 = isalnum((int)cVar4);
if ((iVar3 == 0) && (cVar4 != '_')) {
*pcVar5 = '_';
}
else {
*pcVar5 = cVar4;
}
pcVar5 = pcVar5 + 1;
pcVar2 = pcVar2 + 1;
cVar4 = *pcVar2;
} while ((cVar4 != '\0') && ((int)pcVar5 - (int)local_260 < 0x40));
}
*pcVar5 = '\0';
iVar3 = _V_strlen(local_260);
if (0 < iVar3) {
pcVar5 = (char *)CChoreoScene::GetFilename(*(CChoreoScene **)(this + 0x128));
V_strncpy(local_220,pcVar5,0x200);
V_StripFilename(local_220);
V_FixSlashes(local_220,'/');
iVar3 = _V_strstr(local_220,"scenes");
pcVar5 = local_220;
if (iVar3 != 0) {
pcVar5 = (char *)(iVar3 + 6);
if (*(char *)(iVar3 + 6) == '/') {
pcVar5 = (char *)(iVar3 + 7);
}
}
iVar3 = _V_strlen(pcVar5);
if (iVar3 - 1U < 0x1fd) {
pcVar5[iVar3] = '/';
pcVar5[iVar3 + 1] = '\0';
}
if (param_3) {
pcVar2 = "sound/combined/%s%s_$gender.wav";
}
else {
pcVar2 = "sound/combined/%s%s.wav";
}
V_snprintf(param_1,param_2,pcVar2,pcVar5,local_260);
uVar1 = 1;
goto LAB_00ba6cb4;
}
}
uVar1 = 0;
LAB_00ba6cb4:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return uVar1;
}
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.