npc_coords_shift

This commit is contained in:
PikalaxALT 2017-09-08 21:27:02 -04:00
parent 43c3b9fdff
commit 70e982d1fa
3 changed files with 12 additions and 14 deletions

View file

@ -5,18 +5,6 @@
.text
thumb_func_start npc_coords_shift
@ void npc_coords_shift(struct npc_state *fieldObject, u16 x, u16 y)
npc_coords_shift: @ 808EAE4
ldrh r3, [r0, 0x10]
strh r3, [r0, 0x14]
ldrh r3, [r0, 0x12]
strh r3, [r0, 0x16]
strh r1, [r0, 0x10]
strh r2, [r0, 0x12]
bx lr
thumb_func_end npc_coords_shift
thumb_func_start npc_coords_set
@ void npc_coords_set(struct npc_state *fieldObject, u16 x, u16 y)
npc_coords_set: @ 808EAF4

View file

@ -44,6 +44,7 @@ void sub_808E7E4(u8, u8, u8);
void sub_808E78C(u8, u8, u8, u8);
void sub_808E75C(s16, s16);
void FieldObjectGetLocalIdAndMap(struct MapObject *, u8 *, u8 *, u8 *);
void npc_coords_shift(struct MapObject *, s16, s16);
// Exported data declarations

View file

@ -1222,6 +1222,15 @@ void unref_sub_808EAC4(struct MapObject *mapObject, s16 x, s16 y)
{
mapObject->coords3.x = mapObject->coords2.x;
mapObject->coords3.y = mapObject->coords2.y;
mapObject->coords2.x = x + mapObject->coords3.x;
mapObject->coords2.y = y + mapObject->coords3.y;
mapObject->coords2.x += x;
mapObject->coords2.y += y;
}
void npc_coords_shift(struct MapObject *mapObject, s16 x, s16 y)
{
mapObject->coords3.x = mapObject->coords2.x;
mapObject->coords3.y = mapObject->coords2.y;
mapObject->coords2.x = x;
mapObject->coords2.y = y;
}