From 517b218b093708ff1a10c3ed2474cf3395564741 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Tue, 19 Dec 2017 21:39:21 +0100 Subject: Copyright stuff. --- src/game/interface.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src/game/interface.cpp') diff --git a/src/game/interface.cpp b/src/game/interface.cpp index 0c2125b..5e5dc70 100644 --- a/src/game/interface.cpp +++ b/src/game/interface.cpp @@ -1,3 +1,20 @@ +/* +This file is part of Minitrem. + +Minitrem is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Minitrem is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Minitrem. If not, see . +*/ + #include "game.hpp" #include @@ -39,7 +56,13 @@ void state_t::tick(double dt) view_size.y = view_scale * size.y / size.x; } - if (game->selected_units.size() && camera.following) { + if (!game->selected_units.size() && camera.following) { + camera.center = camera.follow_center; + print(text::get(text::FOLLOWING_OFF)); + camera.following = false; + } + + if (camera.following) { for (entity_t *ent : game->selected_units) follow_center += ent->render_bounds.center(); follow_center /= game->selected_units.size(); -- cgit