summaryrefslogtreecommitdiff
path: root/src/game/interface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/interface.cpp')
-rw-r--r--src/game/interface.cpp25
1 files changed, 24 insertions, 1 deletions
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 <http://www.gnu.org/licenses/>.
+*/
+
#include "game.hpp"
#include <iomanip>
@@ -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();