CAnimationLayer::DispatchAnimEvents
0x005ec2b0 · 603 bytes · __thiscall
_ZN15CAnimationLayer18DispatchAnimEventsEP14CBaseAnimatingS1_
Decompiled
undefined (3 params)
/* CAnimationLayer::DispatchAnimEvents(CBaseAnimating*, CBaseAnimating*) */
void __thiscall
CAnimationLayer::DispatchAnimEvents
(CAnimationLayer *this,CBaseAnimating *param_1,CBaseAnimating *param_2)
{
float fVar1;
float fVar2;
float fVar3;
char cVar4;
int iVar5;
int iVar6;
CStudioHdr *pCVar7;
CStudioHdr *pCVar8;
CStudioHdr *this_00;
longdouble lVar9;
float fVar10;
float fVar11;
float local_4c;
animevent_t local_34 [8];
float local_2c;
float local_28;
CBaseAnimating *local_20;
this_00 = *(CStudioHdr **)(param_2 + 0x13e0);
if (this_00 == (CStudioHdr *)0x0) {
iVar6 = CBaseEntity::GetModel((CBaseEntity *)param_2);
if (iVar6 == 0) {
this_00 = *(CStudioHdr **)(param_2 + 0x13e0);
}
else {
CBaseAnimating::LockStudioHdr(param_2);
this_00 = *(CStudioHdr **)(param_2 + 0x13e0);
}
if (this_00 == (CStudioHdr *)0x0) {
return;
}
}
if (*(int *)this_00 == 0) {
return;
}
cVar4 = CStudioHdr::SequencesAvailable(this_00);
if (cVar4 == '\0') {
return;
}
iVar6 = *(int *)(this + 8);
iVar5 = CStudioHdr::GetNumSeq(this_00);
if (iVar5 <= iVar6) {
return;
}
iVar6 = CStudioHdr::pSeqdesc(this_00,*(int *)(this + 8));
if (*(int *)(iVar6 + 0x18) == 0) {
return;
}
iVar6 = *(int *)(this + 8);
pCVar7 = *(CStudioHdr **)(param_2 + 0x13e0);
if (pCVar7 == (CStudioHdr *)0x0) {
iVar5 = CBaseEntity::GetModel((CBaseEntity *)param_2);
if (iVar5 == 0) {
pCVar7 = *(CStudioHdr **)(param_2 + 0x13e0);
}
else {
CBaseAnimating::LockStudioHdr(param_2);
pCVar7 = *(CStudioHdr **)(param_2 + 0x13e0);
}
pCVar8 = (CStudioHdr *)0x0;
if (pCVar7 == (CStudioHdr *)0x0) goto LAB_005ec330;
}
pCVar8 = (CStudioHdr *)0x0;
if (*(int *)pCVar7 != 0) {
pCVar8 = pCVar7;
}
LAB_005ec330:
lVar9 = (longdouble)CBaseAnimating::GetSequenceCycleRate(param_2,pCVar8,iVar6);
fVar11 = (float)lVar9 * *(float *)(this + 0x18);
fVar1 = *(float *)(this + 0x40);
local_4c = *(float *)(this + 0xc);
if ((this[5] == (CAnimationLayer)0x0) &&
((iVar6 = CStudioHdr::pSeqdesc(this_00,*(int *)(this + 8)),
1.0 - fVar11 * *(float *)(iVar6 + 0x6c) <= local_4c || (local_4c < 0.0)))) {
local_4c = 1.01;
this[4] = (CAnimationLayer)0x1;
}
iVar6 = 0;
*(float *)(this + 0x40) = local_4c;
while (iVar6 = GetAnimationEvent(this_00,*(int *)(this + 8),local_34,fVar1,local_4c,iVar6),
iVar6 != 0) {
local_20 = param_2;
if (0.0 < fVar11) {
fVar2 = *(float *)(this + 0xc);
fVar10 = local_2c;
if (fVar2 < local_2c) {
fVar10 = local_2c - 1.0;
}
fVar3 = *(float *)(param_2 + 0x90);
lVar9 = (longdouble)CBaseAnimating::GetAnimTimeInterval(param_2);
local_28 = (float)lVar9 + fVar3 + (fVar10 - fVar2) * (1.0 / fVar11);
}
(**(code **)(*(int *)param_1 + 0x368))(param_1,local_34);
}
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.