Use array for TM Learnset bitmasks

This commit is contained in:
Rachel
2025-01-15 23:33:01 -08:00
parent 92cd212dea
commit d9df079829
2 changed files with 5 additions and 8 deletions

View File

@@ -54,10 +54,7 @@ typedef struct SpeciesData {
u8 flipSprite : 1;
// u16 padding;
u32 tmLearnsetMask1; // Bitflags for whether this pokemon can learn a TM (TM1 -> TM32)
u32 tmLearnsetMask2; // Bitflags for whether this pokemon can learn a TM (TM33 -> TM64)
u32 tmLearnsetMask3; // Bitflags for whether this pokemon can learn a TM (TM65 -> TM92, HM1 -> HM4)
u32 tmLearnsetMask4; // Bitflags for whether this pokemon can learn a TM (HM5 -> HM8, rest unused)
u32 tmLearnsetMasks[4]; // Bitflags for whether this pokemon can learn a TM
} SpeciesData;
typedef struct SpeciesEvolution {

View File

@@ -2099,16 +2099,16 @@ u32 SpeciesData_GetValue(SpeciesData *speciesData, enum SpeciesDataParam param)
result = speciesData->flipSprite;
break;
case SPECIES_DATA_TM_LEARNSET_MASK_1:
result = speciesData->tmLearnsetMask1;
result = speciesData->tmLearnsetMasks[0];
break;
case SPECIES_DATA_TM_LEARNSET_MASK_2:
result = speciesData->tmLearnsetMask2;
result = speciesData->tmLearnsetMasks[1];
break;
case SPECIES_DATA_TM_LEARNSET_MASK_3:
result = speciesData->tmLearnsetMask3;
result = speciesData->tmLearnsetMasks[2];
break;
case SPECIES_DATA_TM_LEARNSET_MASK_4:
result = speciesData->tmLearnsetMask4;
result = speciesData->tmLearnsetMasks[3];
break;
}