From 20b189455545db5688ed4f14d2966380137ee2db Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sat, 21 Oct 2017 11:20:34 +0200 Subject: Start working on path finding. --- src/interface.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/interface.cpp') diff --git a/src/interface.cpp b/src/interface.cpp index 17c1727..0650889 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -48,7 +48,12 @@ void state_t::tick(void) return; case sf::Event::MouseButtonPressed: - if (event.mouseButton.button == 1) { + if (event.mouseButton.button == 0) { + v2f_t point = window->mapPixelToCoords( + sf::Vector2i(event.mouseButton.x, + event.mouseButton.y)); + game->debug_click(point); + } else if (event.mouseButton.button == 1) { camera.dragging = true; camera.drag_ref = window->mapPixelToCoords( sf::Vector2i(event.mouseButton.x, -- cgit