Skip to content

Commit

Permalink
Fixed mixup in the config reading that caused keyboard to reset, also…
Browse files Browse the repository at this point in the history
… use reference instead of pointer in JoystickConfig
  • Loading branch information
Grumbel committed Aug 20, 2014
1 parent eaa1442 commit 77d7720
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/control/joystick_config.cpp
Expand Up @@ -155,12 +155,12 @@ JoystickConfig::bind_joybutton(JoyId joy_id, int button, Controller::Control con
}

void
JoystickConfig::read(const lisp::Lisp* joystick_lisp)
JoystickConfig::read(const lisp::Lisp& joystick_lisp)
{
joystick_lisp->get("dead-zone", dead_zone);
joystick_lisp->get("jump-with-up", jump_with_up_joy);
joystick_lisp.get("dead-zone", dead_zone);
joystick_lisp.get("jump-with-up", jump_with_up_joy);

lisp::ListIterator iter(joystick_lisp);
lisp::ListIterator iter(&joystick_lisp);
while(iter.next())
{
if (iter.item() == "map")
Expand Down
2 changes: 1 addition & 1 deletion src/control/joystick_config.hpp
Expand Up @@ -55,7 +55,7 @@ class JoystickConfig
void bind_joyaxis(JoyId joy_id, int axis, Controller::Control c);
void bind_joyhat(JoyId joy_id, int dir, Controller::Control c);

void read(const lisp::Lisp* joystick_lisp);
void read(const lisp::Lisp& joystick_lisp);
void write(Writer& writer);

private:
Expand Down
4 changes: 2 additions & 2 deletions src/supertux/gameconfig.cpp
Expand Up @@ -108,13 +108,13 @@ Config::load()
const lisp::Lisp* keymap_lisp = config_control_lisp->get_lisp("keymap");
if (keymap_lisp)
{
keyboard_config.read(*config_control_lisp);
keyboard_config.read(*keymap_lisp);
}

const lisp::Lisp* joystick_lisp = config_control_lisp->get_lisp("joystick");
if (joystick_lisp)
{
joystick_config.read(joystick_lisp);
joystick_config.read(*joystick_lisp);
}
}

Expand Down

0 comments on commit 77d7720

Please sign in to comment.