Skip to content

Commit df06f10

Browse files
committed
Modified setPedAnimation to play custom animation
1 parent b44dfc1 commit df06f10

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2133,6 +2133,26 @@ bool CStaticFunctionDefinitions::SetPedAnimation ( CClientEntity& Entity, const
21332133
Ped.RunNamedAnimation ( pBlock, szAnimName, iTime, iBlend, bLoop, bUpdatePosition, bInterruptable, bFreezeLastFrame );
21342134
return true;
21352135
}
2136+
else
2137+
{
2138+
CClientIFP * pIFP = g_pClientGame->GetIFPPointerFromMap ( szBlockName );
2139+
2140+
// Is this a custom animation block?
2141+
if ( pIFP )
2142+
{
2143+
// Play the gateway animation
2144+
const SString & strGateWayBlockName = g_pGame->GetAnimManager()->GetGateWayBlockName ( );
2145+
CAnimBlock * pBlock = g_pGame->GetAnimManager ()->GetAnimationBlock ( strGateWayBlockName );
2146+
if ( pBlock )
2147+
{
2148+
Ped.setNextAnimationCustom ( szBlockName, szAnimName );
2149+
2150+
const SString & strGateWayAnimationName = g_pGame->GetAnimManager()->GetGateWayAnimationName ( );
2151+
Ped.RunNamedAnimation ( pBlock, strGateWayAnimationName, iTime, iBlend, bLoop, bUpdatePosition, bInterruptable, bFreezeLastFrame );
2152+
return true;
2153+
}
2154+
}
2155+
}
21362156
}
21372157
else
21382158
{

0 commit comments

Comments
 (0)