Skip to content

Commit bf5e7dc

Browse files
committed
added GetGateWayAnimationName and GetGateWayBlockName. Renamed PedClump to PedPointer of m_mapofPedPointers' functions
1 parent d4b20dd commit bf5e7dc

File tree

2 files changed

+30
-17
lines changed

2 files changed

+30
-17
lines changed

Client/game_sa/CAnimManagerSA.cpp

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -766,23 +766,33 @@ bool CAnimManagerSA::isGateWayAnimationHierarchy ( CAnimBlendHierarchySAInterfac
766766
return pGame->GetKeyGen()->GetUppercaseKey ( m_kGateWayAnimationName.c_str ( ) ) == pInterface->iHashKey;
767767
}
768768

769-
void CAnimManagerSA::InsertPedClumpToMap ( RpClump * pClump, CClientPed * pClientPed )
769+
const SString & CAnimManagerSA::GetGateWayBlockName ( void )
770770
{
771-
if ( m_mapOfPedClumps.count ( pClump ) == 0 )
771+
return m_kGateWayBlockName;
772+
}
773+
774+
const SString & CAnimManagerSA::GetGateWayAnimationName ( void )
775+
{
776+
return m_kGateWayAnimationName;
777+
}
778+
779+
void CAnimManagerSA::InsertPedPointerToMap ( RpClump * pClump, CClientPed * pClientPed )
780+
{
781+
if ( m_mapOfPedPointers.count ( pClump ) == 0 )
772782
{
773-
m_mapOfPedClumps [ pClump ] = pClientPed;
783+
m_mapOfPedPointers [ pClump ] = pClientPed;
774784
}
775785
}
776786

777-
void CAnimManagerSA::RemovePedClumpFromMap ( RpClump * pClump )
787+
void CAnimManagerSA::RemovePedPointerFromMap ( RpClump * pClump )
778788
{
779-
m_mapOfPedClumps.erase ( pClump );
789+
m_mapOfPedPointers.erase ( pClump );
780790
}
781791

782-
CClientPed * CAnimManagerSA::GetClientPedFromClumpMap ( RpClump * pClump )
792+
CClientPed * CAnimManagerSA::GetPedPointerFromMap ( RpClump * pClump )
783793
{
784-
ClumpMap_type::iterator it = m_mapOfPedClumps.find ( pClump );
785-
if ( it != m_mapOfPedClumps.end ( ) )
794+
ClumpMap_type::iterator it = m_mapOfPedPointers.find ( pClump );
795+
if ( it != m_mapOfPedPointers.end ( ) )
786796
{
787797
return it->second;
788798
}

Client/game_sa/CAnimManagerSA.h

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,26 +152,29 @@ class CAnimManagerSA : public CAnimManager
152152
CAnimBlendHierarchy * GetAnimBlendHierarchy ( CAnimBlendHierarchySAInterface * pInterface );
153153

154154
bool isGateWayAnimationHierarchy ( CAnimBlendHierarchySAInterface * pInterface );
155+
const SString & GetGateWayBlockName ( void );
156+
const SString & GetGateWayAnimationName ( void );
155157

156158
// This is used in AddAnimationHandler and AddAnimationAndSyncHandler for playing
157159
// custom animations and to help in replacing and restoring animations
158-
void InsertPedClumpToMap ( RpClump * pClump, CClientPed * pClientPed );
159-
void RemovePedClumpFromMap ( RpClump * pClump );
160-
CClientPed * GetClientPedFromClumpMap ( RpClump * pClump );
160+
void InsertPedPointerToMap ( RpClump * pClump, CClientPed * pClientPed );
161+
void RemovePedPointerFromMap ( RpClump * pClump );
162+
CClientPed * GetPedPointerFromMap ( RpClump * pClump );
161163

162164
private:
163165
CAnimBlendAssocGroup * m_pAnimAssocGroups [ MAX_ANIM_GROUPS ];
164166
CAnimBlendHierarchy * m_pAnimations [ MAX_ANIMATIONS ];
165167
CAnimBlock * m_pAnimBlocks [ MAX_ANIM_BLOCKS ];
166168
std::list < CAnimBlendAssociation * > m_Associations;
167-
ClumpMap_type m_mapOfPedClumps;
169+
ClumpMap_type m_mapOfPedPointers;
168170

169-
// This animation name will allow us to play custom animations by simply playing this animation
171+
// This "gateway" animation will allow us to play custom animations by simply playing this animation
170172
// and then in AddAnimation and AddAnimationAndSync hook, we can return our custom animation in the
171-
// hook instead of run_wuzi. This will trick GTA SA into thinking that it is playing run_wuzi, but in
172-
// reality, it's playing our custom animation, and Of course, we can return run_wuzi animation within
173-
// the hook if we want to play it instead. Why run_wuzi? We can also use another animation, but I've
174-
// tested with this one mostly, so let's stick to this.
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";
175178
const SString m_kGateWayAnimationName = "run_wuzi";
176179

177180
};

0 commit comments

Comments
 (0)