Skip to content

Commit 1694765

Browse files
committed
Added constexpr getAnimAssocGroupInterface function.
1 parent 9b578f9 commit 1694765

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Client/multiplayer_sa/CMultiplayerSA_FixBadAnimId.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,18 @@
1212
#include "StdInc.h"
1313
#include "../game_sa/CAnimBlendAssocGroupSA.h"
1414

15+
constexpr CAnimBlendAssocGroupSAInterface * getAnimAssocGroupInterface ( AssocGroupId animGroup )
16+
{
17+
DWORD * pAnimAssocGroupsArray = reinterpret_cast < DWORD * > ( *(DWORD*)0xb4ea34 );
18+
return reinterpret_cast < CAnimBlendAssocGroupSAInterface * > ( pAnimAssocGroupsArray + 5 * animGroup );
19+
}
20+
1521
////////////////////////////////////////////////////////////////////////////////////////////////
1622
// Check for anims that will crash and change to one that wont. (The new anim will be wrong and look crap though)
17-
int _cdecl OnCAnimBlendAssocGroupCopyAnimation ( CAnimBlendAssocGroupSAInterface* pGroup, int iAnimId )
23+
int _cdecl OnCAnimBlendAssocGroupCopyAnimation ( AssocGroupId animGroup, int iAnimId )
1824
{
25+
auto pGroup = getAnimAssocGroupInterface ( animGroup );
26+
1927
// Apply offset
2028
int iUseAnimId = iAnimId - pGroup->iIDOffset;
2129

0 commit comments

Comments
 (0)