Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use OBJ_EVENT_GFX_SPECIES_MASK in bufferspeciesname #5088

Merged

Conversation

SBird1337
Copy link
Collaborator

ScrCmd_bufferspeciesname would truncate species above 1023.

Issue(s) that this PR fixes

fixes #5087

Discord contact info

karathan

@@ -1693,7 +1693,7 @@ bool8 ScrCmd_vmessage(struct ScriptContext *ctx)
bool8 ScrCmd_bufferspeciesname(struct ScriptContext *ctx)
{
u8 stringVarIndex = ScriptReadByte(ctx);
u16 species = VarGet(ScriptReadHalfword(ctx)) & ((1 << 10) - 1); // ignore possible shiny / form bits
u16 species = VarGet(ScriptReadHalfword(ctx)) & OBJ_EVENT_GFX_SPECIES_MASK; // ignore possible shiny / form bits
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's used for more than just GFX we probably ought to rename the define

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not give it too much thought, idk why we have to do it this way or why it's required in bufferspeciesname. I don't have a good name in my head, but if we find one we can change it. (or even refactor this) Currently it just breaks a lot of species printing so I'd like it fixed :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll approve it for now to fix the issue. We can update the name later.

@AsparagusEduardo AsparagusEduardo merged commit 1f93c25 into rh-hideout:master Aug 5, 2024
1 check passed
@Bassoonian Bassoonian added category: pokemon Pertains to Pokémon data and functionality bugfix Bugfixes labels Aug 6, 2024
@Bassoonian Bassoonian changed the title use OBJ_EVENT_GFX_SPECIES_MASK in bufferspeciesname Use OBJ_EVENT_GFX_SPECIES_MASK in bufferspeciesname Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Bugfixes category: pokemon Pertains to Pokémon data and functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bufferspeciesname truncates species above 1023
3 participants