The code in event_object_movement.c indicates that OBJ_EVENT_PAL_TAG_NONE was meant to be a sentinel for the bottom of each of the tables involving palettes in there. sObjectEventSpritePalettes is the exception, but the functions that access it look for OBJ_EVENT_PAL_TAG_NONE even though it's not in the table. If the palette tag isn't in the table, the functions which scan it fall off the bottom of the table into an infinite loop of scanning 256 "entries" of the table (because it uses a u8 index), and the game locks up. In vanilla, the search simply never falls off the bottom of the table. It seems the developers intended for that last entry to be {NULL, OBJ_EVENT_PAL_TAG_NONE}.
- Added a general GetBattleFormChangeTargetSpecies instead of getting specific ones for Mega Evolution and Primal Reversion.
- Added FORM_CHANGE_BATTLE_HP_PERCENT, to replace ShouldChangeFormHpBased.
- Cleaned ifdefs for hold effects.
- Finally removed UndoMegaEvolution.
- FORM_CHANGE_FAINT and FORM_CHANGE_BATTLE_END restore to the first form before a battle form change if species isn't specified.
- When changing from a form with more HP to one with less, now current HP is kept to fix Zygarde edge case. (Will likely need to be reworked for Dynamax, as it behaves differently)
- Uses DoesSpeciesUseHoldItemToChangeForm in CanBattlerGetOrLoseItem.
Misc:
-Made the ability pop up stick around until the ability's effect ends just like in ORAS.
-Updated sText_BadDreamsDmg accordingly while I was at it.
Fix Justified, Berserk, Rattled, Stamina and Water Compaction printing the wrong message when they activate. Steam Engine was also updated to follow the gen 5+ ability activation method style.
- Pinning the GF Header, crt0, and main to the front of the ROM when building modern.
- Moving the gflib before other source files, to make it closer to the non-modern linker script (and therefore smaller patches).
- Pinning the GF Header, crt0, and main to the front of the ROM when building modern.
- Moving the gflib before other source files, to make it closer to the non-modern linker script (and therefore smaller patches).