rh-hideout / pokeemerald-expansion

Feature branche for the pokeemerald decompilation. See the wiki for more info.
336 stars 994 forks source link

Hidden Power always Physical when the Physical/Special Split is off #5052

Closed Dreaker75 closed 1 month ago

Dreaker75 commented 1 month ago

Description

When B_PHYSICAL_SPECIAL_SPLIT is set to GEN_3, the move Hidden Power will always be physical due to the function GetBattleMoveCategory() in src/battle_util.c checking the move's type in gMovesInfo. Since Hidden Power's base type is Normal, and the function doesn't take into account its dynamic type, Hidden Power is always treated as a Physical move, regardless of its actual type.

Version

1.8.5 (Latest release)

Upcoming/master Version

No response

Discord contact info

No response

AlexOn1ine commented 1 month ago

if you have a fix in mind please pr

Dreaker75 commented 1 month ago

Sorry, never done a PR before, and from what I could see from the code, the best solution seems to be passsing in the Pokemon's information to the function to get the IVs and do the Hidden Power check there. But not sure if this would be the best way to go about it.

Dreaker75 commented 1 month ago

Oh, I actually tried that, but when I did that it had a small visual bug when B_SHOW_CATEGORY_ICON was on. All damage-dealing moves had the Special category icon for some reason, is that giving you the same issue as well?

hedara90 commented 1 month ago

I see that, gBattleStruct->dynamicMoveType is probably filled with garbage that usually makes the return value go above TYPE_MYSTERY and therefore return a special type. Good catch.