summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2021-11-16 10:53:18 -0500
committerGriffinR <griffin.g.richards@gmail.com>2021-11-16 13:10:23 -0500
commit63c5905914b40d33e45a6a3101ab5a7da4375918 (patch)
tree6c45c1e31f395f94e7aa90f781ed919e909dab1e /src
parent04cc923d6c17edae778f14cb431991867a05cf65 (diff)
Continue updating event macro comments
Diffstat (limited to 'src')
-rw-r--r--src/scrcmd.c4
-rw-r--r--src/script_menu.c3
-rwxr-xr-xsrc/script_pokemon_util.c5
3 files changed, 10 insertions, 2 deletions
diff --git a/src/scrcmd.c b/src/scrcmd.c
index 563ff2222..98eaaf12c 100644
--- a/src/scrcmd.c
+++ b/src/scrcmd.c
@@ -1458,7 +1458,9 @@ bool8 ScrCmd_showmonpic(struct ScriptContext *ctx)
bool8 ScrCmd_hidemonpic(struct ScriptContext *ctx)
{
- bool8 (*func)(void) = ScriptMenu_GetPicboxWaitFunc();
+ // The hide function returns a pointer to a function
+ // that returns true once the pic is hidden
+ bool8 (*func)(void) = ScriptMenu_HidePokemonPic();
if (func == NULL)
return FALSE;
diff --git a/src/script_menu.c b/src/script_menu.c
index ae0fe91e6..1680758f2 100644
--- a/src/script_menu.c
+++ b/src/script_menu.c
@@ -563,6 +563,7 @@ static void Task_PokemonPicWindow(u8 taskId)
task->tState++;
break;
case 1:
+ // Wait until state is advanced by ScriptMenu_HidePokemonPic
break;
case 2:
FreeResourcesAndDestroySprite(&gSprites[task->tMonSpriteId], task->tMonSpriteId);
@@ -600,7 +601,7 @@ bool8 ScriptMenu_ShowPokemonPic(u16 species, u8 x, u8 y)
}
}
-bool8 (*ScriptMenu_GetPicboxWaitFunc(void))(void)
+bool8 (*ScriptMenu_HidePokemonPic(void))(void)
{
u8 taskId = FindTaskIdByFunc(Task_PokemonPicWindow);
diff --git a/src/script_pokemon_util.c b/src/script_pokemon_util.c
index 07e86656e..ae7aa92dc 100755
--- a/src/script_pokemon_util.c
+++ b/src/script_pokemon_util.c
@@ -150,7 +150,12 @@ void CreateScriptedWildMon(u16 species, u8 level, u16 item)
void ScriptSetMonMoveSlot(u8 monIndex, u16 move, u8 slot)
{
+// Allows monIndex to go out of bounds of gPlayerParty. Doesn't occur in vanilla
+#ifdef BUGFIX
+ if (monIndex >= PARTY_SIZE)
+#else
if (monIndex > PARTY_SIZE)
+#endif
monIndex = gPlayerPartyCount - 1;
SetMonMoveSlot(&gPlayerParty[monIndex], move, slot);