Skip to content

Commit

Permalink
Fix Koume evaluating to never give pictograph box. (#82)
Browse files Browse the repository at this point in the history
Fix remove models from being rendered in the song of healing models as there was undefined behaviour.

Fix possible actor leak in Dm_Char03.
  • Loading branch information
PhlexPlexico authored Jul 11, 2024
1 parent 4aecaa9 commit 2beeb66
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions code/include/rnd/actors/dm_char03.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ namespace rnd {
extern "C" float rDmChar03Scale;
void Dm_Char03_Init(game::act::Actor* actor, game::GlobalContext* gctx);
void Dm_Char03_Draw(game::act::Actor* actor, game::GlobalContext* gctx);
void Dm_Char03_Destroy(game::act::Actor* actor, game::GlobalContext* gctx);

} // namespace rnd
#endif
7 changes: 2 additions & 5 deletions code/source/asm/patches.s
Original file line number Diff line number Diff line change
Expand Up @@ -285,17 +285,14 @@ RemoveJimWhenExitingHideout_patch:
@ This patch performs the same event check to see if Koume was saved,
@ overriding the check to see if woodfall was cleared. This is due
@ to the fact you could beat the temple out of logic from saving koume
@ so this removes the temple check, and checks to see if she was saved twice.
@ For more information on the message system, see the following links in MM decomp
@ so this changes to a weekevent reg that is seemingly not used in game
@ and should always evaluate to false.
@ https://github.com/zeldaret/mm/blob/6541532abb5c03088ad67748bbb23965c654127e/src/overlays/actors/ovl_En_Dnh/z_en_dnh.c#L21
@ https://github.com/zeldaret/mm/blob/main/include/z64msgevent.h#L354
.section .patch_RemoveWoodfallClearConditionFromBoatHouse
.global patch_RemoveWoodfallClearConditionFromBoatHouse
patch_RemoveWoodfallClearConditionFromBoatHouse:
.byte 0x0C
.byte 0x08
.byte 0x00
.byte 0x08

.section .patch_loader
.global loader_patch
Expand Down
5 changes: 5 additions & 0 deletions code/source/rnd/actors/dm_char03.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@ namespace rnd {
util::GetPointer<void(game::act::Actor*, game::GlobalContext*)>(0x41CE70)(actor, gctx);
}

void Dm_Char03_Destroy(game::act::Actor* actor, game::GlobalContext* gctx) {
Model_DestroyByActor(actor);
util::GetPointer<void(game::act::Actor*, game::GlobalContext*)>(0x2043cc)(actor, gctx);
}

} // namespace rnd
7 changes: 4 additions & 3 deletions code/source/rnd/models.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,10 @@ namespace rnd {

overlayTable[0x12B].info->init_fn = Dm_Char03_Init;
overlayTable[0x12B].info->draw_fn = Dm_Char03_Draw;
overlayTable[0x12B].info->deinit_fn = Dm_Char03_Destroy;

overlayTable[0x12D].info->init_fn = DMChar05_Init;
overlayTable[0x12D].info->draw_fn = DMChar05_Draw;
overlayTable[0x12D].info->deinit_fn = DMChar05_Destroy;
// overlayTable[0x12D].info->init_fn = DMChar05_Init;
// overlayTable[0x12D].info->draw_fn = DMChar05_Draw;
// overlayTable[0x12D].info->deinit_fn = DMChar05_Destroy;
}
} // namespace rnd

0 comments on commit 2beeb66

Please sign in to comment.