Fix crash in en_fsn (#359)

* Fix the bug maybe?

* Comment

* Add another fix

* Another better fix

* Fix again
This commit is contained in:
louist103
2024-05-22 09:05:04 -05:00
committed by Garrett Cox
parent f17da19bf6
commit 0287fa2fef
2 changed files with 7 additions and 1 deletions
@@ -1480,8 +1480,12 @@ void EnFsn_Init(Actor* thisx, PlayState* play) {
EnFsn* this = THIS;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f);
// #region 2S2H [Port] ENFSN_LIMB_MAX originally had a +1 because the game incorrectly thought the skel had 18 limbs when it
// only has 17. We also need to patch the count in skelAnime because it is reading the wrong number from the skeleton header.
SkelAnime_InitFlex(play, &this->skelAnime, &gFsnSkel, &gFsnIdleAnim, this->jointTable, this->morphTable,
ENFSN_LIMB_MAX);
this->skelAnime.limbCount = ENFSN_LIMB_MAX;
if (ENFSN_IS_SHOP(&this->actor)) {
this->actor.shape.rot.y = BINANG_ROT180(this->actor.shape.rot.y);
+3 -1
View File
@@ -13,7 +13,9 @@
#define ENFSN_ANGRY (1 << 8)
#define ENFSN_CALM_DOWN (1 << 9)
#define ENFSN_LIMB_MAX FSN_LIMB_MAX + 1 // Note: adding 1 to FSN_LIMB_MAX due to bug in the skeleton, see bug in object_fsn.xml
//#region 2S2H [Port] This originally had a +1 because the game incorrectly thought the skel had 18 limbs when it only has 17.
#define ENFSN_LIMB_MAX FSN_LIMB_MAX
struct EnFsn;