From 111b655b09dea1ea438b355af9659728495901e1 Mon Sep 17 00:00:00 2001 From: Kp Date: Thu, 6 Aug 2020 03:47:56 +0000 Subject: [PATCH] Remove GM_GAME_OVER Various sites assign GM_GAME_OVER to Game_mode, but no sites test for it. Its only value would be to clear out other flags, but that can be done by clearing Game_mode. --- common/main/game.h | 1 - similar/main/game.cpp | 4 ++-- similar/main/inferno.cpp | 2 +- similar/main/net_udp.cpp | 4 ++-- similar/main/newdemo.cpp | 3 +-- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/common/main/game.h b/common/main/game.h index 1abe04211..f3fd083fb 100644 --- a/common/main/game.h +++ b/common/main/game.h @@ -85,7 +85,6 @@ extern std::array Marker_viewer_num; // left & right #define GM_MULTI_COOP 16 // You are in a multiplayer mode and can't hurt other players. // #define GM_MODEM 32 // You are in a modem (serial) game // OBSOLETE #define GM_UNKNOWN 64 // You are not in any mode, kind of dangerous... -#define GM_GAME_OVER 128 // Game has been finished #define GM_TEAM 256 // Team mode for network play #if defined(DXX_BUILD_DESCENT_I) #define GM_BOUNTY 512 // New bounty mode by Matt1360 diff --git a/similar/main/game.cpp b/similar/main/game.cpp index 74f58c8a9..46b19bc3f 100644 --- a/similar/main/game.cpp +++ b/similar/main/game.cpp @@ -135,7 +135,7 @@ int force_cockpit_redraw=0; int PaletteRedAdd, PaletteGreenAdd, PaletteBlueAdd; int Game_suspended=0; //if non-zero, nothing moves but player -int Game_mode = GM_GAME_OVER; +int Game_mode; int Global_missile_firing_count = 0; } @@ -1647,7 +1647,7 @@ window_event_result game_handler(window *,const d_event &event, const unused_win songs_play_song( SONG_TITLE, 1 ); game_disable_cheats(); - Game_mode = GM_GAME_OVER; + Game_mode = {}; #if DXX_USE_EDITOR if (!EditorWindow) // have to do it this way because of the necessary longjmp. Yuck. #endif diff --git a/similar/main/inferno.cpp b/similar/main/inferno.cpp index f519f7366..bf5de1dae 100644 --- a/similar/main/inferno.cpp +++ b/similar/main/inferno.cpp @@ -711,7 +711,7 @@ static int main(int argc, char *argv[]) #endif #endif { - Game_mode = GM_GAME_OVER; + Game_mode = {}; DoMenu(); } diff --git a/similar/main/net_udp.cpp b/similar/main/net_udp.cpp index c8969f110..430ec97e4 100644 --- a/similar/main/net_udp.cpp +++ b/similar/main/net_udp.cpp @@ -4518,7 +4518,7 @@ static int net_udp_start_game(void) if (!net_udp_select_players() || StartNewLevel(Netgame.levelnum) == window_event_result::close) { - Game_mode = GM_GAME_OVER; + Game_mode = {}; return 0; // see if we want to tweak the game we setup } state_set_next_autosave(GameUniqueState, Netgame.MPGameplayOptions.AutosaveInterval); @@ -4558,7 +4558,7 @@ static int net_udp_wait_for_sync(void) me.player.callsign = get_local_player().callsign; net_udp_send_sequence_packet(me, Netgame.players[0].protocol.udp.addr); N_players = 0; - Game_mode = GM_GAME_OVER; + Game_mode = {}; return(-1); // they cancelled } return(0); diff --git a/similar/main/newdemo.cpp b/similar/main/newdemo.cpp index 4efb196a4..a583e9af2 100644 --- a/similar/main/newdemo.cpp +++ b/similar/main/newdemo.cpp @@ -4259,8 +4259,7 @@ void newdemo_stop_playback() #if defined(DXX_BUILD_DESCENT_II) nd_playback_v_guided = 0; #endif - Newdemo_game_mode = Game_mode = GM_GAME_OVER; - + Newdemo_game_mode = Game_mode = {}; // Required for the editor obj_relink_all(); }