Skip to content

Commit cc5b9ed

Browse files
committed
Removed CAnimBlendAssoc_Hierarchy_Constructor hook and handler
1 parent e557b62 commit cc5b9ed

File tree

6 files changed

+3
-156
lines changed

6 files changed

+3
-156
lines changed

Client/mods/deathmatch/logic/CClientGame.cpp

Lines changed: 3 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ CClientGame::CClientGame ( bool bLocalPlay )
270270
g_pMultiplayer->SetPostWorldProcessHandler ( CClientGame::StaticPostWorldProcessHandler );
271271
g_pMultiplayer->SetPreFxRenderHandler ( CClientGame::StaticPreFxRenderHandler );
272272
g_pMultiplayer->SetPreHudRenderHandler ( CClientGame::StaticPreHudRenderHandler );
273-
g_pMultiplayer->SetCAnimBlendAssocHierConstructorHandler ( CClientGame::StaticCAnimBlendAssocHierConstructorHandler );
274273
g_pMultiplayer->SetCAnimBlendAssocDestructorHandler ( CClientGame::StaticCAnimBlendAssocDestructorHandler );
275274
g_pMultiplayer->SetAddAnimationHandler ( CClientGame::StaticAddAnimationHandler );
276275
g_pMultiplayer->SetAddAnimationAndSyncHandler ( CClientGame::StaticAddAnimationAndSyncHandler );
@@ -432,7 +431,6 @@ CClientGame::~CClientGame ( void )
432431
g_pMultiplayer->SetPostWorldProcessHandler ( NULL );
433432
g_pMultiplayer->SetPreFxRenderHandler ( NULL );
434433
g_pMultiplayer->SetPreHudRenderHandler ( NULL );
435-
g_pMultiplayer->SetCAnimBlendAssocHierConstructorHandler ( NULL );
436434
g_pMultiplayer->SetCAnimBlendAssocDestructorHandler ( NULL );
437435
g_pMultiplayer->SetAddAnimationHandler ( NULL );
438436
g_pMultiplayer->SetAddAnimationAndSyncHandler ( NULL );
@@ -3701,11 +3699,6 @@ bool CClientGame::StaticChokingHandler ( unsigned char ucWeaponType )
37013699
return g_pClientGame->ChokingHandler ( ucWeaponType );
37023700
}
37033701

3704-
bool CClientGame::StaticCAnimBlendAssocHierConstructorHandler ( SIFPAnimations ** pOutIFPAnimations, CAnimBlendAssociationSAInterface * pThis, RpClump * pClump, CAnimBlendHierarchySAInterface ** pOutAnimHierarchy )
3705-
{
3706-
return g_pClientGame->CAnimBlendAssocHierConstructorHandler ( pOutIFPAnimations, pThis, pClump, pOutAnimHierarchy );
3707-
}
3708-
37093702
void CClientGame::StaticCAnimBlendAssocDestructorHandler ( CAnimBlendAssociationSAInterface * pThis )
37103703
{
37113704
g_pClientGame->CAnimBlendAssocDestructorHandler ( pThis );
@@ -4013,62 +4006,6 @@ bool CClientGame::ChokingHandler ( unsigned char ucWeaponType )
40134006
}
40144007

40154008

4016-
bool CClientGame::CAnimBlendAssocHierConstructorHandler ( SIFPAnimations ** pOutIFPAnimations, CAnimBlendAssociationSAInterface * pThis, RpClump * pClump, CAnimBlendHierarchySAInterface ** pOutAnimHierarchy )
4017-
{
4018-
bool isCustomAnimationToPlay = false;
4019-
4020-
CAnimBlendHierarchySAInterface * pAnimHierarchy = *pOutAnimHierarchy;
4021-
4022-
printf("pAnimHierarchy->usNumSequences: %d\n", pAnimHierarchy->usNumSequences);
4023-
4024-
CAnimManager * pAnimationManager = g_pGame->GetAnimManager();
4025-
CClientPed * pClientPed = GetClientPedByClump ( *pClump );
4026-
if ( pClientPed != nullptr )
4027-
{
4028-
printf ("CAnimBlendAssocHierConstructorHandler: Found pClientPed\n");
4029-
if ( pClientPed->isNextAnimationCustom () )
4030-
{
4031-
const SString & strBlockName = pClientPed->GetNextAnimationCustomBlockName ( );
4032-
CClientIFP * pIFP = GetIFPPointerFromMap ( strBlockName );
4033-
if ( pIFP )
4034-
{
4035-
const SString & strAnimationName = pClientPed->GetNextAnimationCustomName ( );
4036-
auto pCustomAnimBlendHierarchy = pIFP->GetAnimationHierarchy ( strAnimationName );
4037-
if ( pCustomAnimBlendHierarchy != nullptr )
4038-
{
4039-
if ( pIFP->isIFPLoaded ( ) )
4040-
{
4041-
SIFPAnimations * pIFPAnimations = pIFP->GetIFPAnimationsPointer ();
4042-
pIFPAnimations->iReferences ++;
4043-
4044-
pClientPed->setCurrentAnimationCustom ( true );
4045-
pClientPed->setNextAnimationNormal ( );
4046-
4047-
*pOutIFPAnimations = pIFPAnimations;
4048-
*pOutAnimHierarchy = pCustomAnimBlendHierarchy;
4049-
isCustomAnimationToPlay = true;
4050-
return isCustomAnimationToPlay;
4051-
}
4052-
}
4053-
else
4054-
{
4055-
printf ("CAnimBlendAssocHierConstructorHandler: could not find IFP animation hierarchy '%s'\n", strAnimationName.c_str());
4056-
}
4057-
}
4058-
else
4059-
{
4060-
printf("CAnimBlendAssocHierConstructorHandler: could not find IFP block name '%s'\n", strBlockName.c_str());
4061-
}
4062-
}
4063-
4064-
pClientPed->setCurrentAnimationCustom ( false );
4065-
pClientPed->setNextAnimationNormal ( );
4066-
}
4067-
printf("CClientGame::CAnimBlendAssocHierConstructorHandler RETURNING! sAnimID: %d\n", pThis->sAnimID);
4068-
return isCustomAnimationToPlay;
4069-
}
4070-
4071-
40724009
void CClientGame::CAnimBlendAssocDestructorHandler ( CAnimBlendAssociationSAInterface * pThis )
40734010
{
40744011
//printf("CClientGame::CAnimBlendAssocDestructorHandler called! sAnimID: %d\n", pThis->sAnimID);
@@ -4149,7 +4086,7 @@ bool CClientGame::BlendAnimationHierarchyHandler ( SIFPAnimations ** pOutIFPAni
41494086
CClientPed * pClientPed = GetClientPedByClump ( *pClump );
41504087
if ( pClientPed != nullptr )
41514088
{
4152-
printf ("CAnimBlendAssocHierConstructorHandler: Found pClientPed\n");
4089+
printf ("CClientGame::BlendAnimationHierarchyHandler: Found pClientPed\n");
41534090
if ( pClientPed->isNextAnimationCustom () )
41544091
{
41554092
const SString & strBlockName = pClientPed->GetNextAnimationCustomBlockName ( );
@@ -4176,12 +4113,12 @@ bool CClientGame::BlendAnimationHierarchyHandler ( SIFPAnimations ** pOutIFPAni
41764113
}
41774114
else
41784115
{
4179-
printf ("CAnimBlendAssocHierConstructorHandler: could not find IFP animation hierarchy '%s'\n", strAnimationName.c_str());
4116+
printf ("CClientGame::BlendAnimationHierarchyHandler: could not find IFP animation hierarchy '%s'\n", strAnimationName.c_str());
41804117
}
41814118
}
41824119
else
41834120
{
4184-
printf("CAnimBlendAssocHierConstructorHandler: could not find IFP block name '%s'\n", strBlockName.c_str());
4121+
printf("CClientGame::BlendAnimationHierarchyHandler: could not find IFP block name '%s'\n", strBlockName.c_str());
41854122
}
41864123
}
41874124

Client/mods/deathmatch/logic/CClientGame.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,6 @@ class CClientGame
503503
static void StaticPostWorldProcessHandler ( void );
504504
static void StaticPreFxRenderHandler ( void );
505505
static void StaticPreHudRenderHandler ( void );
506-
static bool StaticCAnimBlendAssocHierConstructorHandler ( SIFPAnimations ** pOutIFPAnimations, CAnimBlendAssociationSAInterface * pThis, RpClump * pClump, CAnimBlendHierarchySAInterface ** pOutAnimHierarchy );
507506
static void StaticCAnimBlendAssocDestructorHandler ( CAnimBlendAssociationSAInterface * pThis );
508507
static CAnimBlendAssociationSAInterface * StaticAddAnimationHandler ( RpClump * pClump, AssocGroupId animGroup, AnimationId animID );
509508
static CAnimBlendAssociationSAInterface * StaticAddAnimationAndSyncHandler( RpClump * pClump, CAnimBlendAssociationSAInterface * pAnimAssocToSyncWith, AssocGroupId animGroup, AnimationId animID );
@@ -538,7 +537,6 @@ class CClientGame
538537
bool ChokingHandler ( unsigned char ucWeaponType );
539538
void PreWorldProcessHandler ( void );
540539
void PostWorldProcessHandler ( void );
541-
bool CAnimBlendAssocHierConstructorHandler ( SIFPAnimations ** pOutIFPAnimations, CAnimBlendAssociationSAInterface * pThis, RpClump * pClump, CAnimBlendHierarchySAInterface ** pOutAnimHierarchy );
542540
void CAnimBlendAssocDestructorHandler ( CAnimBlendAssociationSAInterface * pThis );
543541
CAnimBlendAssociationSAInterface * AddAnimationHandler ( RpClump * pClump, AssocGroupId animGroup, AnimationId animID );
544542
CAnimBlendAssociationSAInterface * AddAnimationAndSyncHandler ( RpClump * pClump, CAnimBlendAssociationSAInterface * pAnimAssocToSyncWith, AssocGroupId animGroup, AnimationId animID );

Client/multiplayer_sa/CMultiplayerSA.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ DWORD RETURN_CPlantMgr_Render_fail = 0x5DBDAA;
157157
#define HOOKPOS_CEventHandler_ComputeKnockOffBikeResponse 0x4BA06F
158158
DWORD RETURN_CEventHandler_ComputeKnockOffBikeResponse = 0x4BA076;
159159

160-
#define HOOKPOS_CAnimBlendAssoc_Hierarchy_Constructor 0x4CEFC0
161160
#define HOOKPOS_CAnimBlendAssoc_destructor 0x4CECF0
162161
#define HOOKPOS_CAnimBlendAssocGroup_CopyAnimation 0x4CE14C
163162
#define HOOKPOS_CAnimManager_AddAnimation 0x4d3aa0
@@ -636,7 +635,6 @@ void CMultiplayerSA::InitHooks()
636635
HookInstall(HOOKPOS_CGame_Process, (DWORD)HOOK_CGame_Process, 10 );
637636
HookInstall(HOOKPOS_Idle, (DWORD)HOOK_Idle, 10 );
638637
HookInstall(HOOKPOS_CEventHandler_ComputeKnockOffBikeResponse, (DWORD)HOOK_CEventHandler_ComputeKnockOffBikeResponse, 7 );
639-
//HookInstall(HOOKPOS_CAnimBlendAssoc_Hierarchy_Constructor, (DWORD)HOOK_CAnimBlendAssoc_Hierarchy_Constructor, 5 );
640638
HookInstall(HOOKPOS_CAnimBlendAssoc_destructor, (DWORD)HOOK_CAnimBlendAssoc_destructor, 6 );
641639
HookInstall(HOOKPOS_CAnimManager_AddAnimation, (DWORD)HOOK_CAnimManager_AddAnimation, 10 );
642640
HookInstall(HOOKPOS_CAnimManager_AddAnimationAndSync, (DWORD)HOOK_CAnimManager_AddAnimationAndSync, 10 );

Client/multiplayer_sa/CMultiplayerSA.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ class CMultiplayerSA : public CMultiplayer
116116
void SetIdleHandler ( IdleHandler * pHandler );
117117
void SetPreFxRenderHandler ( PreFxRenderHandler * pHandler );
118118
void SetPreHudRenderHandler ( PreHudRenderHandler * pHandler );
119-
void SetCAnimBlendAssocHierConstructorHandler ( CAnimBlendAssocHierConstructorHandler * pHandler );
120119
void SetCAnimBlendAssocDestructorHandler ( CAnimBlendAssocDestructorHandler * pHandler );
121120
void SetAddAnimationHandler ( AddAnimationHandler * pHandler );
122121
void SetAddAnimationAndSyncHandler ( AddAnimationAndSyncHandler * pHandler );

Client/multiplayer_sa/CMultiplayerSA_CustomAnimations.cpp

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ DWORD FUNC_CAnimBlendAssociation__ReferenceAnimBlock = 0x4CEA50;
1414
DWORD FUNC_UncompressAnimation = 0x4D41C0;
1515
DWORD FUNC_CAnimBlendAssociation__CAnimBlendAssociation_hierarchy = 0x4CEFC0;
1616

17-
DWORD RETURN_CAnimBlendAssoc_Hierarchy_Constructor = 0x4CEFC5;
1817
DWORD RETURN_CAnimBlendAssoc_destructor = 0x4CECF6;
1918
DWORD RETURN_CAnimBlendAssocGroup_CopyAnimation_NORMALFLOW =0x4CE151;
2019
DWORD RETURN_CAnimBlendAssocGroup_CopyAnimation = 0x4CE187;
@@ -23,7 +22,6 @@ DWORD RETURN_CAnimManager_AddAnimation = 0x4D3AB1;
2322
DWORD RETURN_CAnimManager_AddAnimationAndSync = 0x4D3B41;
2423
DWORD RETURN_CAnimManager_BlendAnimation_Hierarchy = 0x4D4577;
2524

26-
CAnimBlendAssocHierConstructorHandler * m_pCAnimBlendAssocHierConstructorHandler = nullptr;
2725
CAnimBlendAssocDestructorHandler * m_pCAnimBlendAssocDestructorHandler = nullptr;
2826
AddAnimationHandler * m_pAddAnimationHandler = nullptr;
2927
AddAnimationAndSyncHandler * m_pAddAnimationAndSyncHandler = nullptr;
@@ -33,11 +31,6 @@ BlendAnimationHierarchyHandler * m_pBlendAnimationHierarchyHandler = nullptr;
3331
int _cdecl OnCAnimBlendAssocGroupCopyAnimation ( AssocGroupId animGroup, int iAnimId );
3432
auto CAnimBlendStaticAssociation_FreeSequenceArray = (hCAnimBlendStaticAssociation_FreeSequenceArray)0x4ce9a0;
3533

36-
void CMultiplayerSA::SetCAnimBlendAssocHierConstructorHandler ( CAnimBlendAssocHierConstructorHandler * pHandler )
37-
{
38-
m_pCAnimBlendAssocHierConstructorHandler = pHandler;
39-
}
40-
4134
void CMultiplayerSA::SetCAnimBlendAssocDestructorHandler ( CAnimBlendAssocDestructorHandler * pHandler )
4235
{
4336
m_pCAnimBlendAssocDestructorHandler = pHandler;
@@ -131,82 +124,6 @@ void __cdecl RemoveAnimationAssociationFromMap ( CAnimBlendAssociationSAInterfac
131124
}
132125
}
133126

134-
void _declspec(naked) HOOK_CAnimBlendAssoc_Hierarchy_Constructor ()
135-
{
136-
_asm
137-
{
138-
pushad
139-
}
140-
141-
if ( m_pCAnimBlendAssocHierConstructorHandler )
142-
{
143-
_asm
144-
{
145-
popad
146-
// Here [esp+8] is pAnimHierarchy
147-
push ebx
148-
push edx
149-
push ecx
150-
151-
push ebp
152-
mov ebp, esp
153-
sub esp, 8
154-
155-
mov eax, dword ptr [esp+8+24]
156-
mov [ebp-4], eax
157-
lea eax, [ebp-4]
158-
//mov eax, dword ptr [esp+20h] // pAnimHierarchy [esp+18h]
159-
push eax
160-
mov eax, dword ptr [esp+20h] // pClump [esp+18h]
161-
push eax
162-
push ecx // this
163-
lea edx, [ebp-8]
164-
push edx
165-
call m_pCAnimBlendAssocHierConstructorHandler
166-
add esp, 10h
167-
168-
mov ebx, [ebp-4]
169-
mov edx, [ebp-8]
170-
171-
add esp, 8 // remove space for local var
172-
mov esp, ebp
173-
pop ebp
174-
175-
// Check if it's a custom animation or not
176-
cmp eax, 00
177-
je NOT_CUSTOM_ANIMATION_CAnimBlendAssoc_Hierarchy_Constructor
178-
179-
// replace animation hierarchy with custom hierarchy
180-
mov [esp+8+12], ebx
181-
// pAnimHierarchy = 8
182-
mov [esp+28h+8h+18h], ebx
183-
184-
push edx // pIFPAnimations
185-
mov ecx, [esp+4]
186-
push ecx // pAnimAssociation
187-
call InsertAnimationAssociationToMap
188-
add esp, 8
189-
190-
NOT_CUSTOM_ANIMATION_CAnimBlendAssoc_Hierarchy_Constructor:
191-
pop ecx
192-
pop edx
193-
pop ebx
194-
pushad
195-
jmp NORMAL_FLOW_CAnimBlendAssoc_Hierarchy_Constructor
196-
}
197-
}
198-
199-
_asm
200-
{
201-
NORMAL_FLOW_CAnimBlendAssoc_Hierarchy_Constructor:
202-
popad
203-
xor eax, eax
204-
push esi
205-
mov esi, ecx
206-
jmp RETURN_CAnimBlendAssoc_Hierarchy_Constructor
207-
}
208-
}
209-
210127
void CAnimBlendAssoc_destructor ( CAnimBlendAssociationSAInterface * pThis )
211128
{
212129
RemoveAnimationAssociationFromMap ( pThis );

Client/sdk/multiplayer/CMultiplayer.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ typedef void ( PreFxRenderHandler ) ( void );
7272
typedef void ( PreHudRenderHandler ) ( void );
7373
typedef CAnimBlendAssociationSAInterface * ( AddAnimationHandler ) ( RpClump * pClump, AssocGroupId animGroup, AnimationId animID );
7474
typedef CAnimBlendAssociationSAInterface * ( AddAnimationAndSyncHandler ) ( RpClump * pClump, CAnimBlendAssociationSAInterface * pAnimAssocToSyncWith, AssocGroupId animGroup, AnimationId animID );
75-
typedef bool ( CAnimBlendAssocHierConstructorHandler ) ( SIFPAnimations ** pOutIFPAnimations, CAnimBlendAssociationSAInterface * pThis, RpClump * pClump, CAnimBlendHierarchySAInterface ** pOutAnimHierarchy );
7675
typedef void ( CAnimBlendAssocDestructorHandler ) ( CAnimBlendAssociationSAInterface * pThis );
7776
typedef bool ( AssocGroupCopyAnimationHandler ) ( CAnimBlendStaticAssociationSAInterface * pOutAnimStaticAssoc, SIFPAnimations ** pOutIFPAnimations, RpClump * pClump, CAnimBlendAssocGroupSAInterface * pAnimAssocGroup, AnimationId animID );
7877
typedef bool ( BlendAnimationHierarchyHandler ) ( SIFPAnimations ** pOutIFPAnimations, CAnimBlendHierarchySAInterface ** pOutAnimHierarchy, RpClump * pClump );
@@ -187,7 +186,6 @@ class CMultiplayer
187186
virtual void SetIdleHandler ( IdleHandler * pHandler ) = 0;
188187
virtual void SetPreFxRenderHandler ( PreFxRenderHandler * pHandler ) = 0;
189188
virtual void SetPreHudRenderHandler ( PreHudRenderHandler * pHandler ) = 0;
190-
virtual void SetCAnimBlendAssocHierConstructorHandler ( CAnimBlendAssocHierConstructorHandler * pHandler ) = 0;
191189
virtual void SetCAnimBlendAssocDestructorHandler ( CAnimBlendAssocDestructorHandler * pHandler ) = 0;
192190
virtual void SetAddAnimationHandler ( AddAnimationHandler * pHandler ) = 0;
193191
virtual void SetAddAnimationAndSyncHandler ( AddAnimationAndSyncHandler * pHandler ) = 0;

0 commit comments

Comments
 (0)