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

Remove redundant side macros/funcs #3201

Closed
wants to merge 7 commits into from

Conversation

gruxor
Copy link

@gruxor gruxor commented Aug 3, 2023

Description

Replaces GET_BATTLER_SIDE and GET_BATTLER_SIDE2 with the existing GetBattlerSide, which is now inlined. Also changes all instances of GetBattlerPosition with direct gBattlerPositions usage.

Discord contact info

crater.

include/battle_anim.h Outdated Show resolved Hide resolved
@DizzyEggg
Copy link
Collaborator

Is removing GetBattlerPosition a good idea? I think it's more readable the way it is now.
Also, if someone modified that function to behave differently, it's gonna be a problem.

I would personally make it an inline function like the rest.

@gruxor
Copy link
Author

gruxor commented Aug 3, 2023

Is removing GetBattlerPosition a good idea? I think it's more readable the way it is now. Also, if someone modified that function to behave differently, it's gonna be a problem.

I would personally make it an inline function like the rest.

Re-added and applied everywhere, only uses of gBattlerPositions should be on assignments now. Mostly regex'd and then proofread by the compiler, so could use a manual look-through if someone wants to check over the changed instances.

@gruxor gruxor requested a review from mrgriffin August 3, 2023 20:20
@mrgriffin
Copy link
Collaborator

I can try to review this later in the weekend/next week. If somebody else wants to get to it first they're more than welcome to and I can change my review to approve.

Copy link
Collaborator

@DizzyEggg DizzyEggg left a comment

Choose a reason for hiding this comment

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

Other than the weird extern and conflicts, I think this should be good to go.


static inline struct Pokemon *GetBattlerParty(u32 battlerId)
{
extern u8 GetBattlerSide(u8 battler);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this extern needed here?

@DizzyEggg
Copy link
Collaborator

Replaced by #3299

@DizzyEggg DizzyEggg closed this Sep 14, 2023
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