summaryrefslogtreecommitdiff
path: root/src/field_map_obj.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/field_map_obj.c')
-rw-r--r--src/field_map_obj.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/field_map_obj.c b/src/field_map_obj.c
index 1a4ab1a74..ced0ecb27 100644
--- a/src/field_map_obj.c
+++ b/src/field_map_obj.c
@@ -1279,3 +1279,28 @@ void npc_coords_shift_still(struct MapObject *mapObject)
npc_coords_shift(mapObject, mapObject->coords2.x, mapObject->coords2.y);
}
+void UpdateFieldObjectCoordsForCameraUpdate(void)
+{
+ u8 i;
+ s16 dx;
+ s16 dy;
+
+ if (gCamera.active)
+ {
+ dx = gCamera.x;
+ dy = gCamera.y;
+ for (i = 0; i < NUM_FIELD_OBJECTS; i ++)
+ {
+ if (gMapObjects[i].active)
+ {
+ gMapObjects[i].coords1.x -= dx;
+ gMapObjects[i].coords1.y -= dy;
+ gMapObjects[i].coords2.x -= dx;
+ gMapObjects[i].coords2.y -= dy;
+ gMapObjects[i].coords3.x -= dx;
+ gMapObjects[i].coords3.y -= dy;
+ }
+ }
+ }
+}
+