SetActivityForSequence
0x003fb370 · 220 bytes · __cdecl
_Z22SetActivityForSequenceP10CStudioHdri
Decompiled
undefined (2 params)
/* SetActivityForSequence(CStudioHdr*, int) */
void SetActivityForSequence(CStudioHdr *param_1,int param_2)
{
int iVar1;
char *pcVar2;
int iVar3;
undefined4 uVar4;
iVar1 = CStudioHdr::pSeqdesc(param_1,param_2);
*(uint *)(iVar1 + 0xc) = *(uint *)(iVar1 + 0xc) | 0x1000;
pcVar2 = (char *)GetSequenceActivityName(param_1,param_2);
if (*pcVar2 == '\0') {
return;
}
iVar3 = ActivityList_IndexForName(pcVar2);
if (iVar3 != -1) {
*(int *)(iVar1 + 0x10) = iVar3;
return;
}
if (1 < *(int *)(developer._28_4_ + 0x30)) {
iVar3 = StringAfterPrefix((char *)(*(int *)param_1 + 0xc),"infected/witch");
if (iVar3 == 0) {
iVar3 = StringAfterPrefix((char *)(*(int *)param_1 + 0xc),"infected/common");
if ((iVar3 == 0) && (SetActivityForSequence(CStudioHdr*,int)::__executeCount < 0x42)) {
SetActivityForSequence(CStudioHdr*,int)::__executeCount =
SetActivityForSequence(CStudioHdr*,int)::__executeCount + 1;
DevWarning(2,"Model %s tried to reference unregistered activity: %s \n",
*(int *)param_1 + 0xc,pcVar2);
}
}
}
uVar4 = ActivityList_RegisterPrivateActivity(pcVar2);
*(undefined4 *)(iVar1 + 0x10) = uVar4;
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.