From 6f0c57d228aec4586d4062018b877b5e51e71e3a Mon Sep 17 00:00:00 2001 From: aap Date: Wed, 12 Jun 2019 10:50:23 +0200 Subject: animation fixes --- README.md | 2 +- src/animation/AnimBlendAssocGroup.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5e020987..019f2ff5 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ There are a couple of things that have been reversed for other projects already that could probably be put into this project without too much effort. Again, the list is not complete: -* Animation (https://github.com/aap/iii_anim) +* ~~Animation (https://github.com/aap/iii_anim)~~ * File Loader (https://github.com/aap/librwgta/tree/master/tools/IIItest) * ... diff --git a/src/animation/AnimBlendAssocGroup.cpp b/src/animation/AnimBlendAssocGroup.cpp index 16749504..8b0001ac 100644 --- a/src/animation/AnimBlendAssocGroup.cpp +++ b/src/animation/AnimBlendAssocGroup.cpp @@ -93,7 +93,7 @@ GetModelFromName(const char *name) for(i = 0; i < MODELINFOSIZE; i++){ mi = CModelInfo::GetModelInfo(i); - if(mi->GetRwObject() && RwObjectGetType(mi->GetRwObject()) == rpCLUMP && + if(mi && mi->GetRwObject() && RwObjectGetType(mi->GetRwObject()) == rpCLUMP && strcmpIgnoringDigits(mi->GetName(), name)) return mi; } @@ -152,6 +152,7 @@ CAnimBlendAssocGroup::CreateAssociations(const char *blockName, RpClump *clump, STARTPATCHES + InjectHook(0x4012D0, &CAnimBlendAssocGroup::DestroyAssociations, PATCH_JUMP); InjectHook(0x4013D0, (CAnimBlendAssociation *(CAnimBlendAssocGroup::*)(uint32))&CAnimBlendAssocGroup::GetAnimation, PATCH_JUMP); InjectHook(0x401300, (CAnimBlendAssociation *(CAnimBlendAssocGroup::*)(const char*))&CAnimBlendAssocGroup::GetAnimation, PATCH_JUMP); InjectHook(0x401420, (CAnimBlendAssociation *(CAnimBlendAssocGroup::*)(uint32))&CAnimBlendAssocGroup::CopyAnimation, PATCH_JUMP); -- cgit v1.2.3