home · contact · privacy
Scrolling pad now also has its own function with its own sanity checks.
[plomrogue] / roguelike.c
index 362826c9b863a3c78808a33a0eb2241000b8138e..e7ece3a0a58601b8d99a22b40ec1a10959e28422 100644 (file)
@@ -475,9 +475,9 @@ int main () {
     if      (key == get_action_key(world.keybindings, "quit"))
       break;
     else if (key == get_action_key(world.keybindings, "scroll pad right"))
-      win_meta.pad_offset++;
-    else if (key == get_action_key(world.keybindings, "scroll pad left") && win_meta.pad_offset > 0)
-      win_meta.pad_offset--;
+      scroll_pad (&win_meta, '+');
+    else if (key == get_action_key(world.keybindings, "scroll pad left"))
+      scroll_pad (&win_meta, '-');
     else if (key == get_action_key(world.keybindings, "toggle keys window"))
       toggle_window(&win_meta, &win_keys);
     else if (key == get_action_key(world.keybindings, "toggle map window"))