1
0
mirror of https://github.com/blawar/ooot.git synced 2024-06-30 16:29:55 +00:00

Forest Temple Door Fix (#173)

* Fixed the doors of the forest temple.

* Surrounded the change by N64_VERSION ifdef

Co-authored-by: DaMarkov <DaMarkovZED@gmail.com>
This commit is contained in:
DaMarkov 2022-02-20 18:16:58 +01:00 committed by GitHub
parent 5e5d5d64dd
commit 15aa150fa5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -298,7 +298,7 @@ enum SceneID {
/* 0x00 */ SCENE_YDAN,
/* 0x01 */ SCENE_DDAN,
/* 0x02 */ SCENE_BDAN,
/* 0x03 */ SCENE_BMORI1,
/* 0x03 */ SCENE_BMORI1,//Forest temple
/* 0x04 */ SCENE_HIDAN,
/* 0x05 */ SCENE_MIZUSIN,
/* 0x06 */ SCENE_JYASINZOU,

View File

@ -65,6 +65,9 @@ static EnDoorInfo sDoorInfo[] = {
{ SCENE_MIZUSIN, 2, OBJECT_MIZU_OBJECTS },
{ SCENE_HAKADAN, 3, OBJECT_HAKA_DOOR },
{ SCENE_HAKADANCH, 3, OBJECT_HAKA_DOOR },
#ifdef N64_VERSION
{ SCENE_BMORI1, 0, OBJECT_GAMEPLAY_KEEP },//Doors in the forest temple. Might be incorrect
#endif
// KEEP objects should remain last and in pthis order
{ -1, 0, OBJECT_GAMEPLAY_KEEP },
{ -1, 4, OBJECT_GAMEPLAY_FIELD_KEEP },
@ -101,11 +104,14 @@ void EnDoor_Init(Actor* thisx, GlobalContext* globalCtx2) {
objectInfo = &sDoorInfo[0];
Actor_ProcessInitChain(&pthis->actor, sInitChain);
SkelAnime_Init(globalCtx, &pthis->skelAnime, &gDoorSkel, &gDoor3Anim, pthis->jointTable, pthis->morphTable, 5);
// Find the correct door depending on the scene number
for (i = 0; i < ARRAY_COUNT(sDoorInfo) - 2; i++, objectInfo++) {
if (globalCtx->sceneNum == objectInfo->sceneNum) {
break;
}
}
// Not found in the sDoorInfo array
if (i >= ARRAY_COUNT(sDoorInfo) - 2 && Object_GetIndex(&globalCtx->objectCtx, OBJECT_GAMEPLAY_FIELD_KEEP) >= 0) {
objectInfo++;
}