Skip to content

Commit

Permalink
Fix null compass
Browse files Browse the repository at this point in the history
  • Loading branch information
sahroush committed Apr 30, 2023
1 parent 8b31e0b commit 8c04769
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CXX = g++
CXXFLAGS = -std=c++11 -Wall -fsanitize=address -fsanitize=undefined
CXXFLAGS = -std=c++11 -Wall #-fsanitize=address -fsanitize=undefined
LFLAGS = -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio
SRC_FILES = $(wildcard ./src/*.cpp)
OBJ_FILES = $(SRC_FILES:./src/%.cpp=./obj/%.o)
Expand Down
2 changes: 2 additions & 0 deletions src/level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ void Level::update_compass(){
}

void Level::render_compass(RenderWindow& window){
if(remaining_cherry_count == 0)
return;
auto view_cen = view.getCenter();
compass->set_position(view_cen.x + WIDTH/2.f - level::MARGIN, view_cen.y - HEIGHT/2.f + level::MARGIN);
int rotation = compass->get_sprite().getRotation();
Expand Down

0 comments on commit 8c04769

Please sign in to comment.