Added follower object to ScrCmd_release.
This commit is contained in:
parent
acdeb438a8
commit
4ba4fa2172
2 changed files with 19 additions and 1 deletions
|
@ -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)
|
||||
|
|
18
src/scrcmd.c
18
src/scrcmd.c
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue