From a79217c471516edd5d5d3f23cc996a89e691a687 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Mon, 22 Feb 2021 06:03:07 +0100 Subject: [PATCH] make fitz run more stable --- d3xp/MultiplayerGame.cpp | 34 ++++++++++++++++++++-------------- d3xp/Player.cpp | 4 ++++ 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/d3xp/MultiplayerGame.cpp b/d3xp/MultiplayerGame.cpp index ec9dfa8..51fa6e5 100644 --- a/d3xp/MultiplayerGame.cpp +++ b/d3xp/MultiplayerGame.cpp @@ -204,12 +204,15 @@ void idMultiplayerGame::Reset() { mapList = uiManager->AllocListGUI( ); mapList->Config( mainGui, "mapList" ); // set this GUI so that our Draw function is still called when it becomes the active/fullscreen GUI - mainGui->SetStateBool( "gameDraw", true ); - mainGui->SetKeyBindingNames(); - mainGui->SetStateInt( "com_machineSpec", cvarSystem->GetCVarInteger( "com_machineSpec" ) ); - SetMenuSkin(); + if(mainGui) { // DG: in fitz this is NULL + mainGui->SetStateBool( "gameDraw", true ); + mainGui->SetKeyBindingNames(); + mainGui->SetStateInt( "com_machineSpec", cvarSystem->GetCVarInteger( "com_machineSpec" ) ); + SetMenuSkin(); + } msgmodeGui = uiManager->FindGui( "guis/mpmsgmode.gui", true, false, true ); - msgmodeGui->SetStateBool( "gameDraw", true ); + if(msgmodeGui) // DG: in fitz this is NULL + msgmodeGui->SetStateBool( "gameDraw", true ); ClearGuis(); ClearChatData(); warmupEndTime = 0; @@ -304,14 +307,16 @@ void idMultiplayerGame::ClearGuis() { int i; for ( i = 0; i < MAX_CLIENTS; i++ ) { - scoreBoard->SetStateString( va( "player%i",i+1 ), "" ); - scoreBoard->SetStateString( va( "player%i_score", i+1 ), "" ); - scoreBoard->SetStateString( va( "player%i_tdm_tscore", i+1 ), "" ); - scoreBoard->SetStateString( va( "player%i_tdm_score", i+1 ), "" ); - scoreBoard->SetStateString( va( "player%i_wins", i+1 ), "" ); - scoreBoard->SetStateString( va( "player%i_status", i+1 ), "" ); - scoreBoard->SetStateInt( va( "rank%i", i+1 ), 0 ); - scoreBoard->SetStateInt( "rank_self", 0 ); + if(scoreBoard) { // DG: in fitz, this is NULL + scoreBoard->SetStateString( va( "player%i",i+1 ), "" ); + scoreBoard->SetStateString( va( "player%i_score", i+1 ), "" ); + scoreBoard->SetStateString( va( "player%i_tdm_tscore", i+1 ), "" ); + scoreBoard->SetStateString( va( "player%i_tdm_score", i+1 ), "" ); + scoreBoard->SetStateString( va( "player%i_wins", i+1 ), "" ); + scoreBoard->SetStateString( va( "player%i_status", i+1 ), "" ); + scoreBoard->SetStateInt( va( "rank%i", i+1 ), 0 ); + scoreBoard->SetStateInt( "rank_self", 0 ); + } idPlayer *player = static_cast( gameLocal.entities[ i ] ); if ( !player || !player->hud ) { @@ -320,7 +325,8 @@ void idMultiplayerGame::ClearGuis() { player->hud->SetStateString( va( "player%i",i+1 ), "" ); player->hud->SetStateString( va( "player%i_score", i+1 ), "" ); player->hud->SetStateString( va( "player%i_ready", i+1 ), "" ); - scoreBoard->SetStateInt( va( "rank%i", i+1 ), 0 ); + if(scoreBoard) + scoreBoard->SetStateInt( va( "rank%i", i+1 ), 0 ); player->hud->SetStateInt( "rank_self", 0 ); } diff --git a/d3xp/Player.cpp b/d3xp/Player.cpp index ee9bb02..b59f3c9 100644 --- a/d3xp/Player.cpp +++ b/d3xp/Player.cpp @@ -4397,6 +4397,8 @@ idPlayer::NextWeapon */ void idPlayer::NextWeapon( void ) { + return; // DG: don't run into endless loop when using mousewheel due to lack of weapons + const char *weap; int w; @@ -4453,6 +4455,8 @@ idPlayer::PrevWeapon */ void idPlayer::PrevWeapon( void ) { + return; // DG: don't run into endless loop when using mousewheel due to lack of weapons + const char *weap; int w;