File tree Expand file tree Collapse file tree 1 file changed +39
-6
lines changed Expand file tree Collapse file tree 1 file changed +39
-6
lines changed Original file line number Diff line number Diff line change @@ -5384,20 +5384,42 @@ void _declspec(naked) HOOK_CAnimBlendAssocGroup_CopyAnimation ()
5384
5384
{
5385
5385
_asm
5386
5386
{
5387
- popad
5387
+ popad
5388
+
5389
+ push ecx
5390
+ push ebp
5391
+ mov ebp, esp
5392
+ sub esp, 4
5393
+
5388
5394
push eax
5389
5395
push ecx
5390
5396
push edi
5391
5397
5398
+ lea eax, [ebp-4 ]
5399
+ push eax
5400
+
5392
5401
// Allocate memory for our new static association
5393
5402
call AllocateStaticAssociationMemory
5394
5403
mov edi, eax
5395
-
5404
+
5396
5405
// push the static association
5397
5406
push edi
5398
- call m_pAssocGroupCopyAnimationHandler // CAnimBlendAssocGroup_CopyAnimation
5399
- add esp, 10h
5407
+ call m_pAssocGroupCopyAnimationHandler
5408
+ add esp, 14h
5409
+
5410
+ mov ecx, [ebp-4 ]
5400
5411
5412
+ add esp, 4 // remove space for local var
5413
+ mov esp, ebp
5414
+ pop ebp
5415
+
5416
+ // save eax and ecx for later to check whether current animation is custom or not
5417
+ // after calling FUNC_CAnimBlendAssociation_Constructor function
5418
+ push eax
5419
+ push ecx
5420
+
5421
+ // get "this" from stack that we pushed first
5422
+ mov ecx, [esp+8 ]
5401
5423
mov ecx, [ecx+4 ]
5402
5424
sub eax, edx
5403
5425
push esi
@@ -5413,9 +5435,9 @@ void _declspec(naked) HOOK_CAnimBlendAssocGroup_CopyAnimation ()
5413
5435
push 3Ch
5414
5436
call FUNC_NEW_OPERATOR
5415
5437
add esp, 8
5416
- mov [esp+14h ], eax
5438
+ mov [esp+20h ], eax
5417
5439
test eax, eax
5418
- mov [esp+0Ch ], 0
5440
+ mov [esp+18h ], 0
5419
5441
jz ERROR_CopyAnimation
5420
5442
push esi
5421
5443
mov ecx, eax
@@ -5427,8 +5449,19 @@ void _declspec(naked) HOOK_CAnimBlendAssocGroup_CopyAnimation ()
5427
5449
call DeleteStaticAssociation
5428
5450
add esp, 4
5429
5451
5452
+ pop ecx
5453
+ pop eax
5454
+
5455
+ // Check wether this is a custom animation or not
5456
+ cmp al, 0
5457
+ je NOT_CUSTOM_ANIMATION_CopyAnimation
5458
+
5459
+ // It's a custom animation, store it in a map
5460
+
5461
+ NOT_CUSTOM_ANIMATION_CopyAnimation:
5430
5462
// put CAnimBlendAssociation in eax
5431
5463
mov eax, edi
5464
+ add esp, 4
5432
5465
jmp RETURN_CAnimBlendAssocGroup_CopyAnimation
5433
5466
5434
5467
ERROR_CopyAnimation:
You can’t perform that action at this time.
0 commit comments