Stop hard-coding number of preset names
This commit is contained in:
@@ -503,7 +503,9 @@ static const u8 *const sFemalePresetNames[] = {
|
|||||||
gText_DefaultNameHalie
|
gText_DefaultNameHalie
|
||||||
};
|
};
|
||||||
|
|
||||||
// .text
|
// The number of male vs. female names is assumed to be the same.
|
||||||
|
// If they aren't, the smaller of the two sizes will be used and any extra names will be ignored.
|
||||||
|
#define NUM_PRESET_NAMES min(ARRAY_COUNT(sMalePresetNames), ARRAY_COUNT(sFemalePresetNames))
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@@ -1597,7 +1599,7 @@ static void Task_NewGameBirchSpeech_StartNamingScreen(u8 taskId)
|
|||||||
{
|
{
|
||||||
FreeAllWindowBuffers();
|
FreeAllWindowBuffers();
|
||||||
FreeAndDestroyMonPicSprite(gTasks[taskId].tLotadSpriteId);
|
FreeAndDestroyMonPicSprite(gTasks[taskId].tLotadSpriteId);
|
||||||
NewGameBirchSpeech_SetDefaultPlayerName(Random() % 20);
|
NewGameBirchSpeech_SetDefaultPlayerName(Random() % NUM_PRESET_NAMES);
|
||||||
DestroyTask(taskId);
|
DestroyTask(taskId);
|
||||||
DoNamingScreen(NAMING_SCREEN_PLAYER, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, CB2_NewGameBirchSpeech_ReturnFromNamingScreen);
|
DoNamingScreen(NAMING_SCREEN_PLAYER, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, CB2_NewGameBirchSpeech_ReturnFromNamingScreen);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user