CBaseFlex::ProcessSequenceSceneEvent
0x00625e50 · 819 bytes · __thiscall
_ZN9CBaseFlex25ProcessSequenceSceneEventEP15CSceneEventInfoP12CChoreoSceneP12CChoreoEvent
Decompiled
undefined (4 params)
/* CBaseFlex::ProcessSequenceSceneEvent(CSceneEventInfo*, CChoreoScene*, CChoreoEvent*) */
CBaseFlex __thiscall
CBaseFlex::ProcessSequenceSceneEvent
(CBaseFlex *this,CSceneEventInfo *param_1,CChoreoScene *param_2,CChoreoEvent *param_3)
{
CBaseFlex CVar1;
bool bVar2;
char cVar3;
int iVar4;
uint uVar5;
int iVar6;
CStudioHdr *pCVar7;
CStudioHdr *pCVar8;
longdouble lVar9;
longdouble lVar10;
longdouble lVar11;
float fVar12;
float fVar13;
float fVar14;
if (((param_1 == (CSceneEventInfo *)0x0) || (param_3 == (CChoreoEvent *)0x0)) ||
(param_2 == (CChoreoScene *)0x0)) {
return (CBaseFlex)0x0;
}
iVar4 = *(int *)(param_1 + 0x14);
bVar2 = false;
if (iVar4 == -2) {
cVar3 = HandleStartSequenceSceneEvent
(this,param_1,param_2,param_3,*(CChoreoActor **)(param_1 + 8));
if (cVar3 == '\0') {
return (CBaseFlex)0x0;
}
iVar4 = *(int *)(param_1 + 0x14);
bVar2 = true;
}
if (iVar4 < 0) {
return (CBaseFlex)0x1;
}
lVar9 = (longdouble)CChoreoScene::GetTime(param_2);
lVar9 = (longdouble)CChoreoEvent::GetIntensity(param_3,(float)lVar9);
fVar13 = (float)lVar9;
if (bVar2) {
fVar13 = 0.0;
}
cVar3 = (**(code **)(*(int *)this + 0x154))(this);
fVar14 = *(float *)(param_1 + 0x24);
if (cVar3 == '\0') {
if (0.8 <= fVar14) {
fVar12 = 1.0;
fVar14 = 1.0;
}
else {
fVar14 = fVar14 + 0.2;
fVar12 = fVar14 * fVar14 * 3.0 - (fVar14 + fVar14) * fVar14 * fVar14;
}
fVar12 = fVar12 * fVar13;
*(float *)(param_1 + 0x24) = fVar14;
}
else {
if (fVar14 <= 0.2) {
fVar12 = 0.0;
fVar14 = 0.0;
}
else {
fVar14 = fVar14 - 0.2;
fVar12 = (fVar14 * fVar14 * 3.0 - (fVar14 + fVar14) * fVar14 * fVar14) * fVar13;
}
*(float *)(param_1 + 0x24) = fVar14;
}
CBaseAnimatingOverlay::SetLayerWeight
((CBaseAnimatingOverlay *)this,*(int *)(param_1 + 0x14),fVar12);
pCVar7 = *(CStudioHdr **)(this + 0x13e0);
iVar4 = *(int *)(param_1 + 0x1c);
if (pCVar7 == (CStudioHdr *)0x0) {
iVar6 = CBaseEntity::GetModel((CBaseEntity *)this);
if (iVar6 == 0) {
pCVar7 = *(CStudioHdr **)(this + 0x13e0);
}
else {
CBaseAnimating::LockStudioHdr((CBaseAnimating *)this);
pCVar7 = *(CStudioHdr **)(this + 0x13e0);
}
pCVar8 = (CStudioHdr *)0x0;
if (pCVar7 != (CStudioHdr *)0x0) goto LAB_00625f60;
}
else {
LAB_00625f60:
pCVar8 = (CStudioHdr *)0x0;
if (*(int *)pCVar7 != 0) {
pCVar8 = pCVar7;
}
}
uVar5 = GetSequenceFlags(pCVar8,iVar4);
if ((uVar5 & 1) != 0) goto LAB_00625f7d;
lVar9 = (longdouble)CChoreoScene::GetTime(param_2);
lVar10 = (longdouble)CChoreoEvent::GetStartTime(param_3);
pCVar7 = *(CStudioHdr **)(this + 0x13e0);
iVar4 = *(int *)(param_1 + 0x1c);
if (pCVar7 == (CStudioHdr *)0x0) {
iVar6 = CBaseEntity::GetModel((CBaseEntity *)this);
if (iVar6 == 0) {
pCVar7 = *(CStudioHdr **)(this + 0x13e0);
}
else {
CBaseAnimating::LockStudioHdr((CBaseAnimating *)this);
pCVar7 = *(CStudioHdr **)(this + 0x13e0);
}
pCVar8 = (CStudioHdr *)0x0;
if (pCVar7 != (CStudioHdr *)0x0) goto LAB_006260a0;
}
else {
LAB_006260a0:
pCVar8 = (CStudioHdr *)0x0;
if (*(int *)pCVar7 != 0) {
pCVar8 = pCVar7;
}
}
lVar11 = (longdouble)CBaseAnimating::SequenceDuration((CBaseAnimating *)this,pCVar8,iVar4);
fVar13 = ((float)lVar9 - (float)lVar10) / (float)lVar11;
if (fVar13 <= 0.0) {
fVar13 = 0.0;
}
if (1.0 <= fVar13) {
fVar13 = 1.0;
}
CBaseAnimatingOverlay::SetLayerCycle
((CBaseAnimatingOverlay *)this,*(int *)(param_1 + 0x14),fVar13);
LAB_00625f7d:
CVar1 = this[0x17d0];
if (CVar1 == (CBaseFlex)0x0) {
return (CBaseFlex)0x1;
}
iVar4 = *(int *)(param_1 + 0x18);
iVar6 = GetScenePriority(this,param_2);
CBaseAnimatingOverlay::SetLayerPriority
((CBaseAnimatingOverlay *)this,*(int *)(param_1 + 0x14),iVar4 + iVar6);
return CVar1;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.