Skip to content

Commit 280922a

Browse files
committed
Changed implementation.
1 parent 83c3f3b commit 280922a

3 files changed

Lines changed: 27 additions & 0 deletions

File tree

Core/GameEngine/Include/GameNetwork/LANGameInfo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ class LANGameInfo : public GameInfo
171171

172172
void LANDisplayGameList( GameWindow *gameListbox, LANGameInfo *gameList ); ///< Displays the list of games in a listbox, preserving selections
173173
void LANEnableStartButton(Bool enabled);
174+
void LANDisableButtons();
174175

175176
void LANDisplaySlotList(); ///< Displays the slot list according to TheLANGameInfo
176177
void LANDisplayGameOptions(); ///< Displays the game options according to TheLANGameInfo

Core/GameEngine/Source/GameNetwork/LANAPI.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,13 @@ void LANAPI::update()
589589
// m_gameStartTime is when the next message goes out
590590
// m_gameStartSeconds is how many seconds remain in the message
591591

592+
if (m_gameStartSeconds == 1)
593+
{
594+
// TheSuperHackers @bugfix Disable LAN controls early to avoid a rare crash
595+
// that may happen when using the buttons at the very last moment (after they're deinitialized).
596+
LANDisableButtons();
597+
}
598+
592599
RequestGameStartTimer( m_gameStartSeconds );
593600
}
594601
else if (m_gameStartTime && m_gameStartTime <= now)

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,25 @@ void LANEnableStartButton(Bool enabled)
389389
buttonSelectMap->winEnable(enabled);
390390
}
391391

392+
void LANDisableButtons()
393+
{
394+
buttonStart->winEnable(false);
395+
buttonBack->winEnable(false);
396+
buttonSelectMap->winEnable(false);
397+
checkboxLimitSuperweapons->winEnable(false);
398+
comboBoxStartingCash->winEnable(false);
399+
400+
for (Int i = 0; i < MAX_SLOTS; ++i)
401+
{
402+
comboBoxPlayer[i]->winEnable(false);
403+
comboBoxColor[i]->winEnable(false);
404+
comboBoxPlayerTemplate[i]->winEnable(false);
405+
comboBoxTeam[i]->winEnable(false);
406+
buttonAccept[i]->winEnable(false);
407+
buttonMapStartPosition[i]->winEnable(false);
408+
}
409+
}
410+
392411
static void handleColorSelection(int index)
393412
{
394413
GameWindow *combo = comboBoxColor[index];

0 commit comments

Comments
 (0)