diff --git a/similar/main/automap.cpp b/similar/main/automap.cpp index 080884217..f08ad5386 100644 --- a/similar/main/automap.cpp +++ b/similar/main/automap.cpp @@ -740,7 +740,7 @@ static int automap_process_input(window *wind, d_event *event, automap *am) Controls = am->controls; kconfig_read_controls(event, 1); am->controls = Controls; - memset(&Controls, 0, sizeof(control_info)); + Controls = {}; if ( !am->controls.state.automap && (am->leave_mode==1) ) { diff --git a/similar/main/game.cpp b/similar/main/game.cpp index 6c346f962..e5a79d577 100644 --- a/similar/main/game.cpp +++ b/similar/main/game.cpp @@ -361,7 +361,7 @@ void game_flush_inputs() joy_flush(); mouse_flush(); mouse_get_delta( &dx, &dy, &dz ); // Read mouse - memset(&Controls,0,sizeof(control_info)); + Controls = {}; } /* diff --git a/similar/main/kconfig.cpp b/similar/main/kconfig.cpp index b360ea9fd..544d86183 100644 --- a/similar/main/kconfig.cpp +++ b/similar/main/kconfig.cpp @@ -1480,7 +1480,7 @@ void kconfig_read_controls(d_event *event, int automap_flag) // --- Don't do anything if in debug mode --- if ( keyd_pressed[KEY_DELETE] ) { - memset( &Controls, 0, sizeof(control_info) ); + Controls = {}; return; } #endif