@@ -79,6 +79,7 @@ class CAnimManagerSAInterface
7979
8080class CAnimManagerSA : public CAnimManager
8181{
82+ typedef CAnimBlendStaticAssociationSAInterface * StaticAssocIntface_type;
8283 typedef std::map < RpClump *, CClientPed * > ClumpMap_type;
8384
8485public:
@@ -108,7 +109,7 @@ class CAnimManagerSA : public CAnimManager
108109 const char * GetAnimBlockName ( AssocGroupId groupID );
109110
110111 CAnimBlendAssociation * CreateAnimAssociation ( AssocGroupId animGroup, AnimationId animID );
111- CAnimBlendAssociation * GetAnimAssociation ( AssocGroupId animGroup, AnimationId animID );
112+ StaticAssocIntface_type GetAnimStaticAssociation ( AssocGroupId animGroup, AnimationId animID );
112113 CAnimBlendAssociation * GetAnimAssociation ( AssocGroupId animGroup, const char * szAnimName );
113114 CAnimBlendAssociation * AddAnimation ( RpClump * pClump, AssocGroupId animGroup, AnimationId animID );
114115 CAnimBlendAssociation * AddAnimation ( RpClump * pClump, CAnimBlendHierarchy *, int ID );
@@ -150,18 +151,31 @@ class CAnimManagerSA : public CAnimManager
150151 CAnimBlock * GetAnimBlock ( CAnimBlockSAInterface * pInterface );
151152 CAnimBlendHierarchy * GetAnimBlendHierarchy ( CAnimBlendHierarchySAInterface * pInterface );
152153
154+ bool isGateWayAnimationHierarchy ( CAnimBlendHierarchySAInterface * pInterface );
155+ const SString & GetGateWayBlockName ( void );
156+ const SString & GetGateWayAnimationName ( void );
157+
153158 // This is used in AddAnimationHandler and AddAnimationAndSyncHandler for playing
154159 // custom animations and to help in replacing and restoring animations
155- void InsertPedClumpToMap ( RpClump * pClump, CClientPed * pClientPed );
156- void RemovePedClumpFromMap ( RpClump * pClump );
157- CClientPed * GetClientPedFromClumpMap ( RpClump * pClump );
160+ void InsertPedPointerToMap ( RpClump * pClump, CClientPed * pClientPed );
161+ void RemovePedPointerFromMap ( RpClump * pClump );
162+ CClientPed * GetPedPointerFromMap ( RpClump * pClump );
158163
159164private:
160165 CAnimBlendAssocGroup * m_pAnimAssocGroups [ MAX_ANIM_GROUPS ];
161166 CAnimBlendHierarchy * m_pAnimations [ MAX_ANIMATIONS ];
162167 CAnimBlock * m_pAnimBlocks [ MAX_ANIM_BLOCKS ];
163168 std::list < CAnimBlendAssociation * > m_Associations;
164- ClumpMap_type m_mapOfPedClumps;
169+ ClumpMap_type m_mapOfPedPointers;
170+
171+ // This "gateway" animation will allow us to play custom animations by simply playing this animation
172+ // and then in AddAnimation and AddAnimationAndSync hook, we can return our custom animation in the
173+ // hook instead of run_wuzi. This will trick GTA SA into thinking that it is playing run_wuzi from
174+ // ped block, but in reality, it's playing our custom animation, and Of course, we can return run_wuzi
175+ // animation within the hook if we want to play it instead. Why run_wuzi? We can also use another animation,
176+ // but I've tested with this one mostly, so let's stick to this.
177+ const SString m_kGateWayBlockName = " ped" ;
178+ const SString m_kGateWayAnimationName = " run_wuzi" ;
165179
166180};
167181
0 commit comments