rh-hideout / pokeemerald-expansion

Feature branches for the pokeemerald decompilation. See the wiki for more info.
306 stars 815 forks source link

Minor switch AI refactor #4849

Closed Pawkkie closed 1 week ago

Pawkkie commented 1 week ago

Description

Alex left a comment on #4794 that sounded really sweet, and after noodling with it a bit with he and Egg we've unfortunately determined it's just not a good solution in this specific context in spite of how cool an idea it is, because the requirement for two different array index orders for the different switching behaviours mean we awkwardly need multiple enums and the nonzero array initialization to PARTY_SIZE makes it awkward to replace the big series of ID defines at the top of the GetBestMonIntegrated function. Unfortunate.

That aside, one of the primary goals was to try to make the conditionals section a bit more readable, and Egg had this sweet suggestion for structuring them in the way I've done here. Also taken this opportunity to fix a typo of "per say" to "per se" which is definitely not either my or Egg's fault, adjust a few comments that referenced functions that no longer exist in the conditional block, and swap over the file's remaining gItemsInfo uses to the new ItemID_ ones.

This is a very minor refactor, but given that there are 3 tiny changes that would be nice to have I figured it was worth submitting now before we all forgot about it between now and whenever we add another feature in this section of the codebase.

People who collaborated with me on this PR

Egg, Alex and Duke

Discord contact info

@Pawkkie

Pawkkie commented 1 week ago

I am pretty confident the build failing is the CI's fault, this is a really minor set of changes that compiles and passes tests fine on my end

DizzyEggg commented 1 week ago

Why are you marked as a first-time contributor here? Wtf

AlexOn1ine commented 1 week ago

This looks good, though are we okay with this PR making its way to upcoming and not master? It's fine with me anyway. Technically it does not fix any bugs so I think upcoming is fine

Pawkkie commented 1 week ago

Why are you marked as a first-time contributor here? Wtf

Uh I have no idea I didn't do anything usual when submitting lol

This looks good, though are we okay with this PR making its way to upcoming and not master? It's fine with me anyway. Technically it does not fix any bugs so I think upcoming is fine

This is why I put it to upcoming, I'm happy to retarget it if we think that makes more sense though :)