CBaseFlex::AddFlexAnimation
0x00626540 · 1705 bytes · __thiscall
_ZN9CBaseFlex16AddFlexAnimationEP15CSceneEventInfo
Decompiled
undefined (2 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CBaseFlex::AddFlexAnimation(CSceneEventInfo*) */
void __thiscall CBaseFlex::AddFlexAnimation(CBaseFlex *this,CSceneEventInfo *param_1)
{
float fVar1;
CChoreoEvent *this_00;
CChoreoScene *this_01;
char cVar2;
bool bVar3;
int iVar4;
int iVar5;
CFlexAnimationTrack *pCVar6;
char *pcVar7;
undefined4 uVar8;
int iVar9;
int in_GS_OFFSET;
longdouble lVar10;
longdouble lVar11;
float fVar12;
int local_240;
undefined4 local_234;
undefined4 local_230;
undefined4 local_22c;
undefined4 local_228;
int local_224;
char local_220 [512];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (((param_1 != (CSceneEventInfo *)0x0) &&
(this_00 = *(CChoreoEvent **)param_1, this_00 != (CChoreoEvent *)0x0)) &&
(this_01 = *(CChoreoScene **)(param_1 + 4), this_01 != (CChoreoScene *)0x0)) {
iVar9 = 0;
cVar2 = CChoreoEvent::GetTrackLookupSet(this_00);
if (cVar2 == '\0') {
for (; iVar4 = CChoreoEvent::GetNumFlexAnimationTracks(this_00), iVar9 < iVar4;
iVar9 = iVar9 + 1) {
pCVar6 = (CFlexAnimationTrack *)CChoreoEvent::GetFlexAnimationTrack(this_00,iVar9);
if (pCVar6 != (CFlexAnimationTrack *)0x0) {
cVar2 = CFlexAnimationTrack::IsComboType(pCVar6);
if (cVar2 == '\0') {
pcVar7 = (char *)CFlexAnimationTrack::GetFlexControllerName(pCVar6);
uVar8 = FindFlexController(this,pcVar7);
CFlexAnimationTrack::SetFlexControllerIndex(pCVar6,uVar8,0,0);
pcVar7 = (char *)CFlexAnimationTrack::GetFlexControllerName(pCVar6);
bVar3 = (bool)CAI_BaseActor::IsServerSideFlexController(pcVar7);
CFlexAnimationTrack::SetServerSide(pCVar6,bVar3);
}
else {
V_strncpy(local_220,"right_",0x200);
pcVar7 = (char *)CFlexAnimationTrack::GetFlexControllerName(pCVar6);
V_strncat(local_220,pcVar7,0x200,-1);
uVar8 = FindFlexController(this,local_220);
CFlexAnimationTrack::SetFlexControllerIndex(pCVar6,uVar8,0,0);
cVar2 = CAI_BaseActor::IsServerSideFlexController(local_220);
if (cVar2 != '\0') {
CFlexAnimationTrack::SetServerSide(pCVar6,true);
}
V_strncpy(local_220,"left_",0x200);
pcVar7 = (char *)CFlexAnimationTrack::GetFlexControllerName(pCVar6);
V_strncat(local_220,pcVar7,0x200,-1);
uVar8 = FindFlexController(this,local_220);
CFlexAnimationTrack::SetFlexControllerIndex(pCVar6,uVar8,0,1);
cVar2 = CAI_BaseActor::IsServerSideFlexController(local_220);
if (cVar2 != '\0') {
CFlexAnimationTrack::SetServerSide(pCVar6,true);
}
}
}
}
CChoreoEvent::SetTrackLookupSet(this_00,true);
}
lVar10 = (longdouble)CChoreoScene::GetTime(this_01);
fVar1 = (float)lVar10;
lVar10 = (longdouble)CChoreoEvent::GetIntensity(this_00,fVar1);
lVar11 = (longdouble)CSceneEventInfo::UpdateWeight(param_1,this);
local_234 = 0;
local_230 = 0;
fVar12 = (float)lVar11 * (float)lVar10;
if (___atan2f_finite == 0) {
local_224 = 0;
}
else {
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_234,0,0,0,0,"/data/src/game/server/baseflex.cpp",0x6c3,
&AddFlexAnimation(CSceneEventInfo*)::tm_fmt,"(%s)%s","Unaccounted",
"AddFlexAnimation_SetFlexWeight");
local_224 = ___atan2f_finite;
}
iVar9 = _DAT_0105db00;
local_22c = local_234;
local_228 = local_230;
/* try { // try from 006266c3 to 006266c7 has its CatchHandler @ 00626bff */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar4 = ThreadGetCurrentId(), iVar9 == iVar4)) {
if ((char *)*_DAT_0105d15c != "AddFlexAnimation_SetFlexWeight") {
/* try { // try from 00626bad to 00626bbe has its CatchHandler @ 00626bff */
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc61580,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
iVar9 = 0;
LAB_006266f8:
/* try { // try from 006266fb to 006267fc has its CatchHandler @ 00626c17 */
iVar5 = CChoreoEvent::GetNumFlexAnimationTracks(this_00);
iVar4 = _DAT_0105db00;
if (iVar5 <= iVar9) goto LAB_006269d8;
pCVar6 = (CFlexAnimationTrack *)CChoreoEvent::GetFlexAnimationTrack(this_00,iVar9);
if ((pCVar6 != (CFlexAnimationTrack *)0x0) &&
(cVar2 = CFlexAnimationTrack::IsTrackActive(pCVar6), cVar2 != '\0')) {
/* try { // try from 00626a63 to 00626b23 has its CatchHandler @ 00626c17 */
if ((g_bClientFlex != '\0') &&
(cVar2 = CFlexAnimationTrack::IsServerSide(pCVar6), cVar2 == '\0')) {
iVar9 = iVar9 + 1;
goto LAB_006266f8;
}
cVar2 = CFlexAnimationTrack::IsComboType(pCVar6);
if (cVar2 == '\0') {
iVar4 = CFlexAnimationTrack::GetRawFlexControllerIndex(pCVar6,0);
lVar10 = (longdouble)CFlexAnimationTrack::GetIntensity(pCVar6,fVar1,0);
if (iVar4 < 0) goto LAB_00626818;
lVar11 = (longdouble)GetFlexWeight(this,iVar4);
SetFlexWeight(this,iVar4,(float)lVar11 * (1.0 - fVar12) + (float)lVar10 * fVar12);
iVar9 = iVar9 + 1;
goto LAB_006266f8;
}
local_240 = 0;
do {
iVar4 = CFlexAnimationTrack::GetRawFlexControllerIndex(pCVar6,local_240);
lVar10 = (longdouble)CFlexAnimationTrack::GetIntensity(pCVar6,fVar1,local_240);
if (-1 < iVar4) {
lVar11 = (longdouble)GetFlexWeight(this,iVar4);
SetFlexWeight(this,iVar4,(float)lVar11 * (1.0 - fVar12) + (float)lVar10 * fVar12);
}
local_240 = local_240 + 1;
} while (local_240 != 2);
}
LAB_00626818:
iVar9 = iVar9 + 1;
goto LAB_006266f8;
}
LAB_00626a43:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return;
LAB_006269d8:
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar9 = ThreadGetCurrentId(), iVar4 == iVar9)) {
cVar2 = CVProfNode::ExitScope();
if (cVar2 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_224 != 0) {
(**(code **)(local_224 + 0x54))(local_224,local_22c,local_228,0,0,0);
}
param_1[0x10] = (CSceneEventInfo)0x1;
goto LAB_00626a43;
}
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.