mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 19:54:21 +01:00
Remove erroneous bugfix
This commit is contained in:
parent
dec54e6e92
commit
95f075ec90
@ -33,6 +33,13 @@
|
|||||||
#include "constants/songs.h"
|
#include "constants/songs.h"
|
||||||
#include "constants/trainers.h"
|
#include "constants/trainers.h"
|
||||||
|
|
||||||
|
// In this file only the values normally associated with Battle Pike and Factory are swapped.
|
||||||
|
// Note that this is *not* a bug, because they are properly swapped consistently in this file.
|
||||||
|
// There would only be an issue if anything in this file interacted with something expecting
|
||||||
|
// the usual value order, or vice versa.
|
||||||
|
#define MATCH_CALL_FACTORY FRONTIER_FACILITY_PIKE
|
||||||
|
#define MATCH_CALL_PIKE FRONTIER_FACILITY_FACTORY
|
||||||
|
|
||||||
// Each match call message has variables that can be populated randomly or
|
// Each match call message has variables that can be populated randomly or
|
||||||
// dependent on the trainer. The below are IDs for how to populate the vars
|
// dependent on the trainer. The below are IDs for how to populate the vars
|
||||||
// in a given message.
|
// in a given message.
|
||||||
@ -1590,6 +1597,7 @@ static const struct MatchCallText *GetGeneralMatchCallText(int matchCallId, u8 *
|
|||||||
rand = Random();
|
rand = Random();
|
||||||
if (!(rand & 1))
|
if (!(rand & 1))
|
||||||
{
|
{
|
||||||
|
// Count the number of facilities with a win streak
|
||||||
for (count = 0, i = 0; i < NUM_FRONTIER_FACILITIES; i++)
|
for (count = 0, i = 0; i < NUM_FRONTIER_FACILITIES; i++)
|
||||||
{
|
{
|
||||||
if (GetFrontierStreakInfo(i, &topic) > 1)
|
if (GetFrontierStreakInfo(i, &topic) > 1)
|
||||||
@ -1598,6 +1606,8 @@ static const struct MatchCallText *GetGeneralMatchCallText(int matchCallId, u8 *
|
|||||||
|
|
||||||
if (count)
|
if (count)
|
||||||
{
|
{
|
||||||
|
// At least one facility with a win streak
|
||||||
|
// Randomly choose one to have a call about
|
||||||
count = Random() % count;
|
count = Random() % count;
|
||||||
for (i = 0; i < NUM_FRONTIER_FACILITIES; i++)
|
for (i = 0; i < NUM_FRONTIER_FACILITIES; i++)
|
||||||
{
|
{
|
||||||
@ -1807,15 +1817,15 @@ static void PopulateSpeciesFromTrainerParty(int matchCallId, u8 *destStr)
|
|||||||
StringCopy(destStr, speciesName);
|
StringCopy(destStr, speciesName);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const u8 *const sBattleFrontierFacilityNames[] =
|
static const u8 *const sBattleFrontierFacilityNames[NUM_FRONTIER_FACILITIES] =
|
||||||
{
|
{
|
||||||
gText_BattleTower2,
|
[FRONTIER_FACILITY_TOWER] = gText_BattleTower2,
|
||||||
gText_BattleDome,
|
[FRONTIER_FACILITY_DOME] = gText_BattleDome,
|
||||||
gText_BattlePalace,
|
[FRONTIER_FACILITY_PALACE] = gText_BattlePalace,
|
||||||
gText_BattleArena,
|
[FRONTIER_FACILITY_ARENA] = gText_BattleArena,
|
||||||
gText_BattlePike,
|
[MATCH_CALL_PIKE] = gText_BattlePike,
|
||||||
gText_BattleFactory,
|
[MATCH_CALL_FACTORY] = gText_BattleFactory,
|
||||||
gText_BattlePyramid,
|
[FRONTIER_FACILITY_PYRAMID] = gText_BattlePyramid,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void PopulateBattleFrontierFacilityName(int matchCallId, u8 *destStr)
|
static void PopulateBattleFrontierFacilityName(int matchCallId, u8 *destStr)
|
||||||
@ -1899,7 +1909,7 @@ static u16 GetFrontierStreakInfo(u16 facilityId, u32 *topicTextId)
|
|||||||
switch (facilityId)
|
switch (facilityId)
|
||||||
{
|
{
|
||||||
case FRONTIER_FACILITY_DOME:
|
case FRONTIER_FACILITY_DOME:
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.domeRecordWinStreaks); i++)
|
||||||
{
|
{
|
||||||
for (j = 0; j < FRONTIER_LVL_MODE_COUNT; j++)
|
for (j = 0; j < FRONTIER_LVL_MODE_COUNT; j++)
|
||||||
{
|
{
|
||||||
@ -1909,11 +1919,7 @@ static u16 GetFrontierStreakInfo(u16 facilityId, u32 *topicTextId)
|
|||||||
}
|
}
|
||||||
*topicTextId = GEN_TOPIC_B_DOME - 1;
|
*topicTextId = GEN_TOPIC_B_DOME - 1;
|
||||||
break;
|
break;
|
||||||
#ifdef BUGFIX
|
case MATCH_CALL_PIKE:
|
||||||
case FRONTIER_FACILITY_PIKE:
|
|
||||||
#else
|
|
||||||
case FRONTIER_FACILITY_FACTORY:
|
|
||||||
#endif
|
|
||||||
for (i = 0; i < FRONTIER_LVL_MODE_COUNT; i++)
|
for (i = 0; i < FRONTIER_LVL_MODE_COUNT; i++)
|
||||||
{
|
{
|
||||||
if (streak < gSaveBlock2Ptr->frontier.pikeRecordStreaks[i])
|
if (streak < gSaveBlock2Ptr->frontier.pikeRecordStreaks[i])
|
||||||
@ -1922,7 +1928,7 @@ static u16 GetFrontierStreakInfo(u16 facilityId, u32 *topicTextId)
|
|||||||
*topicTextId = GEN_TOPIC_B_PIKE - 1;
|
*topicTextId = GEN_TOPIC_B_PIKE - 1;
|
||||||
break;
|
break;
|
||||||
case FRONTIER_FACILITY_TOWER:
|
case FRONTIER_FACILITY_TOWER:
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.towerRecordWinStreaks); i++)
|
||||||
{
|
{
|
||||||
for (j = 0; j < FRONTIER_LVL_MODE_COUNT; j++)
|
for (j = 0; j < FRONTIER_LVL_MODE_COUNT; j++)
|
||||||
{
|
{
|
||||||
@ -1933,7 +1939,7 @@ static u16 GetFrontierStreakInfo(u16 facilityId, u32 *topicTextId)
|
|||||||
*topicTextId = GEN_TOPIC_STREAK_RECORD - 1;
|
*topicTextId = GEN_TOPIC_STREAK_RECORD - 1;
|
||||||
break;
|
break;
|
||||||
case FRONTIER_FACILITY_PALACE:
|
case FRONTIER_FACILITY_PALACE:
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.palaceRecordWinStreaks); i++)
|
||||||
{
|
{
|
||||||
for (j = 0; j < FRONTIER_LVL_MODE_COUNT; j++)
|
for (j = 0; j < FRONTIER_LVL_MODE_COUNT; j++)
|
||||||
{
|
{
|
||||||
@ -1943,12 +1949,8 @@ static u16 GetFrontierStreakInfo(u16 facilityId, u32 *topicTextId)
|
|||||||
}
|
}
|
||||||
*topicTextId = GEN_TOPIC_STREAK_RECORD - 1;
|
*topicTextId = GEN_TOPIC_STREAK_RECORD - 1;
|
||||||
break;
|
break;
|
||||||
#ifdef BUGFIX
|
case MATCH_CALL_FACTORY:
|
||||||
case FRONTIER_FACILITY_FACTORY:
|
for (i = 0; i < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.factoryRecordWinStreaks); i++)
|
||||||
#else
|
|
||||||
case FRONTIER_FACILITY_PIKE:
|
|
||||||
#endif
|
|
||||||
for (i = 0; i < 2; i++)
|
|
||||||
{
|
{
|
||||||
for (j = 0; j < FRONTIER_LVL_MODE_COUNT; j++)
|
for (j = 0; j < FRONTIER_LVL_MODE_COUNT; j++)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user