diff options
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r-- | src/gui/viewport.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index b9abb4952..f30ebaecd 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -897,8 +897,8 @@ void Viewport::moveCameraToActor(const int actorId, const int x, const int y) const Actor *const actor = actorSpriteManager->findBeing(actorId); if (!actor) return; - const Vector actorPos = actor->getPosition(); - const Vector playerPos = player_node->getPosition(); + const Vector &actorPos = actor->getPosition(); + const Vector &playerPos = player_node->getPosition(); mCameraMode = 1; mCameraRelativeX = actorPos.x - playerPos.x + x; mCameraRelativeY = actorPos.y - playerPos.y + y; @@ -909,7 +909,7 @@ void Viewport::moveCameraToPosition(const int x, const int y) if (!player_node) return; - const Vector playerPos = player_node->getPosition(); + const Vector &playerPos = player_node->getPosition(); mCameraMode = 1; mCameraRelativeX = x - playerPos.x; |