fixed nasty bug with mouse actions breaking non-mouse tapes
authorHolger Schemel <info@artsoft.org>
Wed, 5 Apr 2017 21:28:34 +0000 (23:28 +0200)
committerHolger Schemel <info@artsoft.org>
Fri, 23 Mar 2018 22:21:12 +0000 (23:21 +0100)
src/game.c

index 5ff50a1f8e0cfbf5137e19ce8829957a58286c5d..92c54f12e73bafd1ce6e952d5cda1dfdb6ae4fcb 100644 (file)
@@ -10977,6 +10977,9 @@ static byte PlayerActions(struct PlayerInfo *player, byte player_action)
 static void SetMouseActionFromTapeAction(struct MouseActionInfo *mouse_action,
                                         byte *tape_action)
 {
+  if (!tape.use_mouse)
+    return;
+
   mouse_action->lx     = tape_action[TAPE_ACTION_LX];
   mouse_action->ly     = tape_action[TAPE_ACTION_LY];
   mouse_action->button = tape_action[TAPE_ACTION_BUTTON];
@@ -10985,6 +10988,9 @@ static void SetMouseActionFromTapeAction(struct MouseActionInfo *mouse_action,
 static void SetTapeActionFromMouseAction(byte *tape_action,
                                         struct MouseActionInfo *mouse_action)
 {
+  if (!tape.use_mouse)
+    return;
+
   tape_action[TAPE_ACTION_LX]     = mouse_action->lx;
   tape_action[TAPE_ACTION_LY]     = mouse_action->ly;
   tape_action[TAPE_ACTION_BUTTON] = mouse_action->button;