From 64d3a67b0c1750d4ff6f1011b62c0525c335f88e Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 16 Sep 2017 22:27:04 -0400 Subject: [PATCH] FieldObjectMoveDestCoords --- asm/field_map_obj.s | 19 ------------------- src/field_map_obj.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/asm/field_map_obj.s b/asm/field_map_obj.s index 79786b208..f0bb2ed2e 100755 --- a/asm/field_map_obj.s +++ b/asm/field_map_obj.s @@ -5,25 +5,6 @@ .text - thumb_func_start FieldObjectMoveDestCoords -@ void FieldObjectMoveDestCoords(struct npc_state *fieldObject, u8 direction) -FieldObjectMoveDestCoords: @ 809316C - push {r4,lr} - lsls r1, 24 - lsrs r1, 24 - ldrh r4, [r0, 0x10] - strh r4, [r2] - ldrh r0, [r0, 0x12] - strh r0, [r3] - adds r0, r1, 0 - adds r1, r2, 0 - adds r2, r3, 0 - bl MoveCoords - pop {r4} - pop {r0} - bx r0 - thumb_func_end FieldObjectMoveDestCoords - thumb_func_start FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive @ bool8 FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive(struct npc_state *fieldObject) FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive: @ 809318C diff --git a/src/field_map_obj.c b/src/field_map_obj.c index de72478cf..fd03082fb 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -3892,6 +3892,16 @@ void GetFieldObjectMovingCameraOffset(s16 *x, s16 *y) } } +void FieldObjectMoveDestCoords(struct MapObject *mapObject, u32 dirn, s16 *x, s16 *y) +{ + u8 direction; + + direction = dirn; + *x = mapObject->coords2.x; + *y = mapObject->coords2.y; + MoveCoords(direction, x, y); +} + asm(".section .text.get_face_direction_anim_id"); void FieldObjectClearAnimIfSpecialAnimActive(struct MapObject *);