From b0af6f8e14449e8bd49efe94da1041628a549120 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Mon, 3 Mar 2008 17:39:02 +0000 Subject: usable models, target_engine --- src/client/input.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/client/input.cc') 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()) -- cgit v1.2.3