Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-03-03 17:39:02 +0000
committerStijn Buys <ingar@osirion.org>2008-03-03 17:39:02 +0000
commitb0af6f8e14449e8bd49efe94da1041628a549120 (patch)
treeaea4b9f1930af1b89e96d05832bc8559fae0a7f0 /src/client/input.cc
parente379b1bfeb231716e07f0e4ae9ef024be9bfd08f (diff)
usable models, target_engine
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())