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

Converted Get(Box)MonData2 to proper functions #3416

Conversation

AsparagusEduardo
Copy link
Collaborator

Description

Fixing a potential issue found by @Pawkkie, where using Get(Box)MonData in a macro caused issues without a NULL as the 3rd argument.

eg.

#define CALC_STAT(base, iv, ev, statIndex, field)               \
{                                                               \
    u8 baseStat = gSpeciesInfo[species].base;                   \
    s32 n = (((2 * baseStat + iv + ev / 4) * level) / 100) + 5; \
-   u8 nature = GetNature(mon);                                 \
+   u8 nature = GetMonData(mon, MON_DATA_NATURE);               \
    n = ModifyStatByNature(nature, n, statIndex);               \
    if (B_FRIENDSHIP_BOOST == TRUE)                             \
        n = n + ((n * 10 * friendship) / (MAX_FRIENDSHIP * 100));\
    SetMonData(mon, field, &n);                                 \
}

Discord message: https://discord.com/channels/419213663107416084/1077168246555430962/1162529804894085151

Images

image

Discord contact info

AsparagusEduardo

@DizzyEggg DizzyEggg merged commit 6016c60 into rh-hideout:upcoming Oct 14, 2023
1 check passed
@AsparagusEduardo AsparagusEduardo deleted the RHH/pr/upcoming/GetBoxMonData_fix branch November 9, 2023 15:45
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.

2 participants