Skip to content

z_player.c: enum for trade item identification#2769

Open
GhostlyDark wants to merge 1 commit into
zeldaret:mainfrom
GhostlyDark:z_player_enum
Open

z_player.c: enum for trade item identification#2769
GhostlyDark wants to merge 1 commit into
zeldaret:mainfrom
GhostlyDark:z_player_enum

Conversation

@GhostlyDark

Copy link
Copy Markdown
Contributor

Use the enum value from item.h instead of the hardcoded 0x18, which equals the first bottle item, seemingly for identifying trade items.

@GhostlyDark GhostlyDark force-pushed the z_player_enum branch 2 times, most recently from c194e8b to 3b1a027 Compare June 12, 2026 16:58
@GhostlyDark

Copy link
Copy Markdown
Contributor Author

Format check appears to be hung up on other files:

+ M src/audio/game/sequence.c
+ M src/boot/inflate.c
+ M src/code/gDPLoadTextureBlock_Runtime.inc.c
+ M src/code/mempak.c
+ M src/code/z_camera.c
+ M src/code/z_vr_box.c
+ M src/libu64/loadfragment2_n64.c
+ M src/libu64/relocation_gc.c
+ M src/overlays/actors/ovl_En_Mag/z_en_mag.c

@Dragorn421

Copy link
Copy Markdown
Collaborator

We use clang-format-14 specifically, probably you have a more recent version installed which would explain the differences and why the format check fails

Use the enum value from item.h instead of the hardcoded 0x18, which equals the first bottle item, seemingly for identifying trade items.
@djevangelia

Copy link
Copy Markdown

This is correct, it looks a bit awkward but this allows using PLAYER_IA enum to convert to EXCH_ITEM despite the fact that PLAYER_IA has the relevant bottle items before the other exchange items (and some non-trade bottle items inbetween) and EXCH_ITEM has bottle items after other exchange items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants