Skip to content

Commit

Permalink
make Player::Collide use a reference of a level, not a copy
Browse files Browse the repository at this point in the history
  • Loading branch information
MESYETI committed Aug 15, 2022
1 parent 50c27c0 commit c4e9908
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/player.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void Player::GoRight(double delta, double multiplier) {
state = PlayerState::Moving;
}

void Player::Collision(Level level) {
void Player::Collision(Level& level) {
if (
(position.x < 0) ||
(position.y < 0) ||
Expand Down
2 changes: 1 addition & 1 deletion src/player.hh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ class Player {
void GoDown(double delta, double multiplier);
void GoLeft(double delta, double multiplier);
void GoRight(double delta, double multiplier);
void Collision(Level level);
void Collision(Level& level);
textureID_t GetTextureID();
};

0 comments on commit c4e9908

Please sign in to comment.