Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/input.cc')
-rw-r--r--src/client/input.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/client/input.cc b/src/client/input.cc
index eda13fd..3b2db09 100644
--- a/src/client/input.cc
+++ b/src/client/input.cc
@@ -24,6 +24,8 @@ namespace input
float local_turn;
// local thrust setting
float local_thrust;
+// last controlled entity
+unsigned int last_control = 0;
void init()
{
@@ -103,6 +105,12 @@ void keypressed(const SDL_keysym &keysym)
void frame(float seconds)
{
+ if (core::localcontrol() && (last_control != core::localcontrol()->id())) {
+ local_turn = core::localcontrol()->direction();
+ local_thrust = core::localcontrol()->thrust();
+ last_control = core::localcontrol()->id();
+ }
+
SDL_Event event;
while (SDL_PollEvent(&event)) {
@@ -117,6 +125,7 @@ void frame(float seconds)
break;
case SDL_KEYDOWN:
if (event.key.keysym.sym == '`' || event.key.keysym.sym == '~') {
+ last_control = 0;
console::toggle();
setkeyboardmode(console::visible());
if (console::visible() && chat::visible())