Added follower object to ScrCmd_release.

This commit is contained in:
Ariel Antonitis 2020-06-16 22:54:56 -04:00
parent acdeb438a8
commit 4ba4fa2172
2 changed files with 19 additions and 1 deletions

View file

@ -1603,7 +1603,7 @@ void FreeAllSpritePalettes(void)
gReservedSpritePaletteCount = 0;
for (i = 0; i < 16; i++)
sSpritePaletteTags[i] = 0xFFFF;
LoadPalette(emptyPalette, i * 16 + 0x100, 32); // TODO: For debugging only
LoadPalette(emptyPalette, i * 16 + 0x100, 32); // TODO: DEBUG: Remove this or battle palettes break
}
u8 LoadSpritePalette(const struct SpritePalette *palette)

View file

@ -1267,6 +1267,15 @@ bool8 ScrCmd_lock(struct ScriptContext *ctx)
bool8 ScrCmd_releaseall(struct ScriptContext *ctx)
{
u8 playerObjectId;
struct ObjectEvent *followerObject = GetFollowerObject();
if (followerObject) { // Release follower from movement
// ObjectEventClearHeldMovement( TODO: Change the way data[1] determines state
followerObject->movementActionId = 0xFF;
followerObject->heldMovementActive = FALSE;
followerObject->heldMovementFinished = FALSE;
gSprites[followerObject->spriteId].data[2] = 0;
// )
}
HideFieldMessageBox();
playerObjectId = GetObjectEventIdByLocalIdAndMap(OBJ_EVENT_ID_PLAYER, 0, 0);
@ -1279,6 +1288,15 @@ bool8 ScrCmd_releaseall(struct ScriptContext *ctx)
bool8 ScrCmd_release(struct ScriptContext *ctx)
{
u8 playerObjectId;
struct ObjectEvent *followerObject = GetFollowerObject();
if (followerObject) { // Release follower from movement
// ObjectEventClearHeldMovement(
followerObject->movementActionId = 0xFF;
followerObject->heldMovementActive = FALSE;
followerObject->heldMovementFinished = FALSE;
gSprites[followerObject->spriteId].data[2] = 0;
// )
}
HideFieldMessageBox();
if (gObjectEvents[gSelectedObjectEvent].active)