CSentence::CreateEventWordDistribution
0x000e0610 · 665 bytes · __thiscall
_ZN9CSentence27CreateEventWordDistributionEPKcf
Decompiled
undefined (3 params)
/* CSentence::CreateEventWordDistribution(char const*, float) */
void __thiscall CSentence::CreateEventWordDistribution(CSentence *this,char *param_1,float param_2)
{
float fVar1;
char cVar2;
char cVar3;
int iVar4;
CWordTag *pCVar5;
char *pcVar6;
int in_GS_OFFSET;
float local_134;
CWordTag *local_128;
CWordTag *local_124;
char local_120 [256];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if ((param_1 == (char *)0x0) || (iVar4 = CountWords(param_1), iVar4 < 1)) {
LAB_000e06df:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
fVar1 = (param_2 - 0.2) / (float)iVar4;
Reset(this);
local_134 = 0.1;
LAB_000e06a8:
do {
pcVar6 = local_120;
cVar3 = *param_1;
while( true ) {
if (cVar3 == '\0') {
*pcVar6 = '\0';
if (local_120[0] != '\0') {
pCVar5 = operator_new(0x2c);
*(undefined4 *)(pCVar5 + 8) = 0;
*(undefined4 *)(pCVar5 + 0xc) = 0;
*(undefined4 *)(pCVar5 + 0x10) = 0;
*(undefined4 *)(pCVar5 + 0x14) = 0;
*(undefined4 *)(pCVar5 + 0x18) = 0;
*(undefined4 *)(pCVar5 + 0x28) = 0;
*(undefined4 *)(pCVar5 + 0x20) = 0;
*(undefined4 *)(pCVar5 + 0x24) = 0;
*(undefined4 *)pCVar5 = 0;
*(undefined4 *)(pCVar5 + 4) = 0;
pCVar5[0x1c] = (CWordTag)0x0;
CWordTag::SetWord(pCVar5,local_120);
*(float *)pCVar5 = local_134;
*(float *)(pCVar5 + 4) = fVar1 + local_134;
local_124 = pCVar5;
CUtlVector<CWordTag*,CUtlMemory<CWordTag*,int>>::InsertBefore
((CUtlVector<CWordTag*,CUtlMemory<CWordTag*,int>> *)(this + 4),
*(int *)(this + 0x10),&local_124);
}
goto LAB_000e06df;
}
if ((cVar3 < '!') || (cVar2 = ShouldSplitWord(cVar3), cVar2 != '\0')) break;
param_1 = param_1 + 1;
*pcVar6 = cVar3;
pcVar6 = pcVar6 + 1;
cVar3 = *param_1;
}
*pcVar6 = '\0';
do {
if ((' ' < cVar3) && (cVar3 = ShouldSplitWord(cVar3), cVar3 == '\0')) {
if (local_120[0] == '\0') goto LAB_000e06a8;
goto LAB_000e0740;
}
param_1 = param_1 + 1;
cVar3 = *param_1;
} while (cVar3 != '\0');
if (local_120[0] != '\0') {
LAB_000e0740:
pCVar5 = operator_new(0x2c);
*(undefined4 *)(pCVar5 + 8) = 0;
*(undefined4 *)(pCVar5 + 0xc) = 0;
*(undefined4 *)(pCVar5 + 0x10) = 0;
*(undefined4 *)(pCVar5 + 0x14) = 0;
*(undefined4 *)(pCVar5 + 0x18) = 0;
*(undefined4 *)(pCVar5 + 0x28) = 0;
*(undefined4 *)(pCVar5 + 0x20) = 0;
*(undefined4 *)(pCVar5 + 0x24) = 0;
*(undefined4 *)pCVar5 = 0;
*(undefined4 *)(pCVar5 + 4) = 0;
pCVar5[0x1c] = (CWordTag)0x0;
CWordTag::SetWord(pCVar5,local_120);
*(float *)pCVar5 = local_134;
local_134 = local_134 + fVar1;
*(float *)(pCVar5 + 4) = local_134;
local_128 = pCVar5;
CUtlVector<CWordTag*,CUtlMemory<CWordTag*,int>>::InsertBefore
((CUtlVector<CWordTag*,CUtlMemory<CWordTag*,int>> *)(this + 4),*(int *)(this + 0x10)
,&local_128);
}
} while( true );
}
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.