Fix the strings length issue
This commit is contained in:
+14
-17
@@ -57,8 +57,6 @@
|
||||
#define PARTY_SIZE 6
|
||||
|
||||
#define POKEMON_SLOTS_NUMBER 412
|
||||
#define POKEMON_NAME_LENGTH 10
|
||||
#define OT_NAME_LENGTH 7
|
||||
|
||||
#define min(a, b) ((a) < (b) ? (a) : (b))
|
||||
#define max(a, b) ((a) >= (b) ? (a) : (b))
|
||||
@@ -134,8 +132,7 @@ enum LanguageId
|
||||
// string lengths
|
||||
#define ITEM_NAME_LENGTH 14
|
||||
#define POKEMON_NAME_LENGTH 10
|
||||
#define OT_NAME_LENGTH 7
|
||||
#define PLAYER_NAME_LENGTH 8
|
||||
#define PLAYER_NAME_LENGTH 7
|
||||
#define MAIL_WORDS_COUNT 9
|
||||
|
||||
enum
|
||||
@@ -326,7 +323,7 @@ struct EmeraldBattleTowerRecord
|
||||
/*0x00*/ u8 battleTowerLevelType; // 0 = level 50, 1 = level 100
|
||||
/*0x01*/ u8 trainerClass;
|
||||
/*0x02*/ u16 winStreak;
|
||||
/*0x04*/ u8 name[8];
|
||||
/*0x04*/ u8 name[PLAYER_NAME_LENGTH + 1];
|
||||
/*0x0C*/ u8 trainerId[4];
|
||||
/*0x10*/ struct {
|
||||
u16 easyChat[6];
|
||||
@@ -450,7 +447,7 @@ struct BattleFrontier
|
||||
/*0xEBF*/ u8 field_EBF;
|
||||
/*0xEC0*/ u16 field_EC0[16];
|
||||
/*0xEE0*/ u8 field_EE0;
|
||||
/*0xEE1*/ u8 field_EE1[2][PLAYER_NAME_LENGTH];
|
||||
/*0xEE1*/ u8 field_EE1[2][PLAYER_NAME_LENGTH + 1];
|
||||
/*0xEF1*/ u8 field_EF1[2][4];
|
||||
/*0xEF9*/ u8 field_EF9;
|
||||
/*0xEFA*/ u8 field_EFA;
|
||||
@@ -460,7 +457,7 @@ struct BattleFrontier
|
||||
|
||||
struct SaveBlock2
|
||||
{
|
||||
/*0x00*/ u8 playerName[PLAYER_NAME_LENGTH];
|
||||
/*0x00*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
|
||||
/*0x08*/ u8 playerGender; // MALE, FEMALE
|
||||
/*0x09*/ u8 specialSaveWarp;
|
||||
/*0x0A*/ u8 playerTrainerId[4];
|
||||
@@ -516,7 +513,7 @@ struct SecretBaseRecord
|
||||
/*0x1A9D*/ u8 gender:1;
|
||||
/*0x1A9D*/ u8 sbr_field_1_5:1;
|
||||
/*0x1A9D*/ u8 sbr_field_1_6:2;
|
||||
/*0x1A9E*/ u8 trainerName[OT_NAME_LENGTH];
|
||||
/*0x1A9E*/ u8 trainerName[PLAYER_NAME_LENGTH];
|
||||
/*0x1AA5*/ u8 trainerId[4]; // byte 0 is used for determining trainer class
|
||||
/*0x1AA9*/ u8 language;
|
||||
/*0x1AAA*/ u16 sbr_field_e;
|
||||
@@ -602,7 +599,7 @@ struct EasyChatPair
|
||||
struct MailStruct
|
||||
{
|
||||
/*0x00*/ u16 words[MAIL_WORDS_COUNT];
|
||||
/*0x12*/ u8 playerName[PLAYER_NAME_LENGTH];
|
||||
/*0x12*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
|
||||
/*0x1A*/ u8 trainerId[4];
|
||||
/*0x1E*/ u16 species;
|
||||
/*0x20*/ u16 itemId;
|
||||
@@ -691,7 +688,7 @@ struct RecordMixing_UnknownStruct
|
||||
|
||||
struct LinkBattleRecord
|
||||
{
|
||||
u8 name[8];
|
||||
u8 name[PLAYER_NAME_LENGTH + 1];
|
||||
u16 trainerId;
|
||||
u16 wins;
|
||||
u16 losses;
|
||||
@@ -724,15 +721,15 @@ struct ContestWinner
|
||||
u32 trainerId;
|
||||
u16 species;
|
||||
u8 contestCategory;
|
||||
u8 monName[11];
|
||||
u8 trainerName[8];
|
||||
u8 monName[POKEMON_NAME_LENGTH + 1];
|
||||
u8 trainerName[PLAYER_NAME_LENGTH + 1];
|
||||
u8 contestRank;
|
||||
};
|
||||
|
||||
struct DayCareMail
|
||||
{
|
||||
struct MailStruct message;
|
||||
u8 OT_name[OT_NAME_LENGTH + 1];
|
||||
u8 OT_name[PLAYER_NAME_LENGTH + 1];
|
||||
u8 monName[POKEMON_NAME_LENGTH + 1];
|
||||
u8 gameLanguage:4;
|
||||
u8 monLanguage:4;
|
||||
@@ -773,7 +770,7 @@ struct LilycoveLadyQuiz
|
||||
/*0x002*/ u16 unk_002[9];
|
||||
/*0x014*/ u16 unk_014;
|
||||
/*0x016*/ u16 unk_016;
|
||||
/*0x018*/ u8 playerName[8];
|
||||
/*0x018*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
|
||||
/*0x020*/ u16 playerTrainerId[4];
|
||||
/*0x028*/ u16 itemId;
|
||||
/*0x02a*/ u8 unk_02a;
|
||||
@@ -788,7 +785,7 @@ struct LilycoveLadyFavour
|
||||
/*0x001*/ u8 phase;
|
||||
/*0x002*/ u8 unk_002;
|
||||
/*0x003*/ u8 unk_003;
|
||||
/*0x004*/ u8 playerName[8];
|
||||
/*0x004*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
|
||||
/*0x00c*/ u8 unk_00c;
|
||||
/*0x00e*/ u16 itemId;
|
||||
/*0x010*/ u16 unk_010;
|
||||
@@ -801,7 +798,7 @@ struct LilycoveLadyContest
|
||||
/*0x001*/ u8 phase;
|
||||
/*0x002*/ u8 fave_pkblk;
|
||||
/*0x003*/ u8 other_pkblk;
|
||||
/*0x004*/ u8 playerName[8];
|
||||
/*0x004*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
|
||||
/*0x00c*/ u8 max_sheen;
|
||||
/*0x00d*/ u8 category;
|
||||
/*0x00e*/ u8 language;
|
||||
@@ -828,7 +825,7 @@ struct WaldaPhrase
|
||||
|
||||
struct UnkSaveSubstruct_3b98 {
|
||||
u32 trainerId;
|
||||
u8 trainerName[8];
|
||||
u8 trainerName[PLAYER_NAME_LENGTH + 1];
|
||||
};
|
||||
|
||||
struct SaveBlock1
|
||||
|
||||
Reference in New Issue
Block a user