diff options
author | Stijn Buys <ingar@osirion.org> | 2008-03-03 17:39:02 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-03-03 17:39:02 +0000 |
commit | b0af6f8e14449e8bd49efe94da1041628a549120 (patch) | |
tree | aea4b9f1930af1b89e96d05832bc8559fae0a7f0 /src/client/input.cc | |
parent | e379b1bfeb231716e07f0e4ae9ef024be9bfd08f (diff) |
usable models, target_engine
Diffstat (limited to 'src/client/input.cc')
-rw-r--r-- | src/client/input.cc | 9 |
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()) |