fabiangreffrath / woof

Woof! is a continuation of the Boom/MBF bloodline of Doom source ports.
GNU General Public License v2.0
186 stars 32 forks source link

Automap input persists when being closed due to death #1737

Closed MrAlaux closed 1 month ago

MrAlaux commented 1 month ago

Tested in the latest master artifact (Win-64).

As you know, the automap is closed automatically upon the player's death. However, when that happens, the inputs aren't cleared, and so they persist when the automap is brought up again.

rfomin commented 1 month ago

Could you please write steps to reproduce the issue. Not sure I understand what the problem is.

MrAlaux commented 1 month ago

Could you please write steps to reproduce the issue. Not sure I understand what the problem is.

Sure thing:

You should see the automap still scrolling despite no keys being pressed.

fabiangreffrath commented 1 month ago

Does this fix it?

--- a/src/am_map.c
+++ b/src/am_map.c
@@ -676,6 +676,7 @@ void AM_Stop (void)
   automapactive = false;
   ST_Responder(&st_notify);
   stopped = true;
+  memset(buttons_state, 0, sizeof(buttons_state));
 }

 //
@@ -843,7 +844,6 @@ boolean AM_Responder
     {
       bigstate = 0;
       viewactive = true;
-      memset(buttons_state, 0, sizeof(buttons_state));
       AM_Stop ();
     }
     else if (M_InputActivated(input_map_gobig))