diff --git a/include/script_movement.h b/include/script_movement.h index ed997dcdd2..f9a97cf46f 100644 --- a/include/script_movement.h +++ b/include/script_movement.h @@ -3,6 +3,6 @@ bool8 ScriptMovement_StartObjectMovementScript(u8 localId, u8 mapNum, u8 mapGroup, const u8 *movementScript); bool8 ScriptMovement_IsObjectMovementFinished(u8 localId, u8 mapNum, u8 mapGroup); -void ScriptMovement_StopAll(void); +void ScriptMovement_UnfreezeEventObjects(void); #endif // GUARD_SCRIPT_MOVEMENT_H diff --git a/src/event_obj_lock.c b/src/event_obj_lock.c index 089c2dc9d4..22a29fd5df 100644 --- a/src/event_obj_lock.c +++ b/src/event_obj_lock.c @@ -92,7 +92,7 @@ void ScriptUnfreezeEventObjects(void) { u8 playerObjectId = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0); EventObjectClearHeldMovementIfFinished(&gEventObjects[playerObjectId]); - ScriptMovement_StopAll(); + ScriptMovement_UnfreezeEventObjects(); UnfreezeEventObjects(); } @@ -104,7 +104,7 @@ void sub_8098524(void) EventObjectClearHeldMovementIfFinished(&gEventObjects[gSelectedEventObject]); playerObjectId = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0); EventObjectClearHeldMovementIfFinished(&gEventObjects[playerObjectId]); - ScriptMovement_StopAll(); + ScriptMovement_UnfreezeEventObjects(); UnfreezeEventObjects(); } diff --git a/src/match_call.c b/src/match_call.c index c6ad4710bd..4b0134d2c1 100644 --- a/src/match_call.c +++ b/src/match_call.c @@ -1290,7 +1290,7 @@ static bool32 sub_81963F0(u8 taskId) sub_81973A4(); playerObjectId = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0); EventObjectClearHeldMovementIfFinished(&gEventObjects[playerObjectId]); - ScriptMovement_StopAll(); + ScriptMovement_UnfreezeEventObjects(); UnfreezeEventObjects(); ScriptContext2_Disable(); } diff --git a/src/mossdeep_gym.c b/src/mossdeep_gym.c index 6cd39063da..880780638e 100644 --- a/src/mossdeep_gym.c +++ b/src/mossdeep_gym.c @@ -55,7 +55,7 @@ void FinishMossdeepGymTiles(void) id = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0); EventObjectClearHeldMovementIfFinished(&gEventObjects[id]); - ScriptMovement_StopAll(); + ScriptMovement_UnfreezeEventObjects(); } u16 MossdeepGym_MoveEvents(u8 arg0) diff --git a/src/scrcmd.c b/src/scrcmd.c index 5ee7ddb0f5..560784c472 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1247,7 +1247,7 @@ bool8 ScrCmd_releaseall(struct ScriptContext *ctx) HideFieldMessageBox(); playerObjectId = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0); EventObjectClearHeldMovementIfFinished(&gEventObjects[playerObjectId]); - ScriptMovement_StopAll(); + ScriptMovement_UnfreezeEventObjects(); UnfreezeEventObjects(); return FALSE; } @@ -1261,7 +1261,7 @@ bool8 ScrCmd_release(struct ScriptContext *ctx) EventObjectClearHeldMovementIfFinished(&gEventObjects[gSelectedEventObject]); playerObjectId = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0); EventObjectClearHeldMovementIfFinished(&gEventObjects[playerObjectId]); - ScriptMovement_StopAll(); + ScriptMovement_UnfreezeEventObjects(); UnfreezeEventObjects(); return FALSE; } diff --git a/src/script_movement.c b/src/script_movement.c index 91a19bb811..03d6b10e89 100644 --- a/src/script_movement.c +++ b/src/script_movement.c @@ -13,7 +13,7 @@ static bool8 ScriptMovement_TryAddNewMovement(u8 taskId, u8 eventObjId, const u8 static u8 GetMovementScriptIdFromEventObjectId(u8 taskId, u8 eventObjId); static bool8 IsMovementScriptFinished(u8 taskId, u8 moveScrId); static void ScriptMovement_AddNewMovement(u8 taskId, u8 moveScrId, u8 eventObjId, const u8 *movementScript); -static void ScriptMovement_UnfreezeObjects(u8 taskId); +static void ScriptMovement_UnfreezeActiveObjects(u8 taskId); static void ScriptMovement_MoveObjects(u8 taskId); static void ScriptMovement_TakeStep(u8 taskId, u8 moveScrId, u8 eventObjId, const u8 *movementScript); @@ -47,14 +47,14 @@ bool8 ScriptMovement_IsObjectMovementFinished(u8 localId, u8 mapNum, u8 mapGroup return IsMovementScriptFinished(taskId, moveScrId); } -void ScriptMovement_StopAll(void) +void ScriptMovement_UnfreezeEventObjects(void) { u8 taskId; taskId = GetMoveObjectsTaskId(); if (taskId != 0xFF) { - ScriptMovement_UnfreezeObjects(taskId); + ScriptMovement_UnfreezeActiveObjects(taskId); DestroyTask(taskId); } } @@ -182,7 +182,7 @@ static void ScriptMovement_AddNewMovement(u8 taskId, u8 moveScrId, u8 eventObjId SetEventObjectIdAtMovementScript(taskId, moveScrId, eventObjId); } -static void ScriptMovement_UnfreezeObjects(u8 taskId) +static void ScriptMovement_UnfreezeActiveObjects(u8 taskId) { u8 *pEventObjId; u8 i;