Skip to content

Commit

Permalink
Fix issue w/ new flags
Browse files Browse the repository at this point in the history
  • Loading branch information
rrealmuto committed Feb 9, 2022
1 parent 2a8374b commit 7e0c5de
Show file tree
Hide file tree
Showing 8 changed files with 11,756 additions and 11,716 deletions.
558 changes: 279 additions & 279 deletions ASM/build/asm_symbols.txt

Large diffs are not rendered by default.

Binary file modified ASM/build/bundle.o
Binary file not shown.
206 changes: 103 additions & 103 deletions ASM/build/c_symbols.txt

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions ASM/c/get_items.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,14 +552,19 @@ bool should_override_collectible(EnItem00* item00)
return 1;
}

void Item00_KillActorIfFlagIsSet(z64_actor_t* actor)
bool Item00_KillActorIfFlagIsSet(z64_actor_t* actor)
{
EnItem00* this = (EnItem00*)actor;
if(should_override_collectible(this))
return;
return 0;
if(get_extended_flag(this) >= 0x40)
return;
z64_ActorKill(actor);
return 0;
if(z64_Flags_GetCollectible(&z64_game, this->collectibleFlag))
{
z64_ActorKill(actor);
return 1;
}

}

//Hack for keeping freestanding overrides alive when they spawn from crates/pots.
Expand Down
13 changes: 12 additions & 1 deletion ASM/src/hacks.asm
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,19 @@ nop
;Hack EnItem00_Init when it checks the scene flags to prevent killing the actor if its being overridden.
;replaces
;jal 0x80020EB4
.orga 0x0A87B10; In Memory 0x80011BB0
;.orga 0x0A87B10; In Memory 0x80011BB0
;jal Item00_KillActorIfFlagIsSet
.headersize(0x80011B98 - 0xA87AF8)
.orga 0xA87AF8; In Memory 0x80011B98
jal Item00_KillActorIfFlagIsSet
or a0, s0, r0
bnez v0, 0x800121A4
lw RA, 0x001c(sp)
b 0x80011Bc0
nop
nop
nop
nop

;Hack Item_DropCollectible to call custom function to determine what item should be dropped based on our override.
;overriding call at 0x8001376C to function 0x80013530
Expand Down
2 changes: 2 additions & 0 deletions ASM/src/item_overrides.asm
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ item00_init_hook:
jr ra
sh T9, 0x001c(S0) ;replaced code



get_override_drop_id_hook:
addiu sp, sp, -0x10
sw ra, 0x00(sp)
Expand Down
Loading

0 comments on commit 7e0c5de

Please sign in to comment.