From 73a13e5dd4856ef3407fd3a60ab5d28c7ab65e0b Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sat, 18 May 2024 10:40:09 -0400 Subject: [PATCH] Some review changes --- gflib/sprite.c | 2 -- include/constants/event_objects.h | 2 +- include/data.h | 7 ++++--- include/follower_helper.h | 12 ++++++++---- src/scrcmd.c | 5 ++--- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/gflib/sprite.c b/gflib/sprite.c index dc15e9cbd2..74e664e72a 100644 --- a/gflib/sprite.c +++ b/gflib/sprite.c @@ -1629,9 +1629,7 @@ void FreeSpritePaletteByTag(u16 tag) { u8 index = IndexOfSpritePaletteTag(tag); if (index != 0xFF) - { sSpritePaletteTags[index] = TAG_NONE; - } } void SetSubspriteTables(struct Sprite *sprite, const struct SubspriteTable *subspriteTables) diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h index 7200d51616..9e37a3277c 100644 --- a/include/constants/event_objects.h +++ b/include/constants/event_objects.h @@ -419,7 +419,7 @@ #define OBJ_EVENT_PAL_TAG_EMOTES 0x8002 // Not a real OW palette tag; used for the white flash applied to followers #define OBJ_EVENT_PAL_TAG_WHITE (OBJ_EVENT_PAL_TAG_NONE - 1) -#define OBJ_EVENT_PAL_TAG_NONE 0x11FF +#define OBJ_EVENT_PAL_TAG_NONE 0x11FF // This + localId is used as the tileTag // for compressed graphicsInfos diff --git a/include/data.h b/include/data.h index 9f76afb1db..893ac12cd1 100644 --- a/include/data.h +++ b/include/data.h @@ -131,15 +131,16 @@ struct TypeInfo //u16 arceusForm; }; -struct FollowerMsgInfo { +struct FollowerMsgInfo +{ const u8 *text; const u8 *script; }; struct FollowerMessagePool { - const struct FollowerMsgInfo * messages; - const u8 * script; + const struct FollowerMsgInfo *messages; + const u8 *script; u16 length; }; diff --git a/include/follower_helper.h b/include/follower_helper.h index c9a9ef4ae6..39d9fc04d4 100644 --- a/include/follower_helper.h +++ b/include/follower_helper.h @@ -17,21 +17,25 @@ enum { }; // Can be either 3 bytes, a u16 and a byte, or a 24-bit value -union __attribute__((packed)) MsgConditionData { +union __attribute__((packed)) MsgConditionData +{ u8 bytes[3]; - struct __attribute__((packed)) { + struct __attribute__((packed)) + { u16 hw; u8 b; } split; u32 raw:24; }; // size = 0x3 -struct __attribute__((packed)) MsgCondition { +struct __attribute__((packed)) MsgCondition +{ u32 type:8; union MsgConditionData data; }; // size = 0x4 -struct FollowerMsgInfoExtended { +struct FollowerMsgInfoExtended +{ const u8 *text; const u8 *script; diff --git a/src/scrcmd.c b/src/scrcmd.c index c8bd1d3387..1a49b0b5e3 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -2189,10 +2189,9 @@ bool8 ScrCmd_playmoncry(struct ScriptContext *ctx) return FALSE; } -bool8 ScrFunc_playfirstmoncry(struct ScriptContext *ctx) +bool8 ScrFunc_playfirstmoncry(struct ScriptContext *ctx) { - u16 species = GetMonData(GetFirstLiveMon(), MON_DATA_SPECIES); - PlayCry_Script(species, 0); + PlayCry_Script(GetMonData(GetFirstLiveMon(), MON_DATA_SPECIES), CRY_MODE_NORMAL); return FALSE; }