Qt: Properly cap number of attached players by platform (fixes #2807)

This commit is contained in:
Vicki Pfau 2023-02-09 00:08:45 -08:00
parent c709aee0f3
commit cade5eebde
2 changed files with 9 additions and 4 deletions

View File

@ -17,6 +17,7 @@ Other fixes:
- Qt: Fix crash when attempting to use OpenGL 2.1 to 3.1 (fixes mgba.io/i/2794)
- Qt: Disable sync while running scripts from main thread (fixes mgba.io/i/2738)
- Qt: Fix savestate preview sizes with different scales (fixes mgba.io/i/2560)
- Qt: Properly cap number of attached players by platform (fixes mgba.io/i/2807)
Misc:
- GB Serialize: Add missing savestate support for MBC6 and NT (newer)
- GBA: Improve detection of valid ELF ROMs

View File

@ -214,10 +214,6 @@ MultiplayerController::~MultiplayerController() {
}
bool MultiplayerController::attachGame(CoreController* controller) {
if (m_lockstep.attached == MAX_GBAS) {
return false;
}
if (m_lockstep.attached == 0) {
switch (controller->platform()) {
#ifdef M_CORE_GBA
@ -243,6 +239,10 @@ bool MultiplayerController::attachGame(CoreController* controller) {
switch (controller->platform()) {
#ifdef M_CORE_GBA
case mPLATFORM_GBA: {
if (m_lockstep.attached >= MAX_GBAS) {
return false;
}
GBA* gba = static_cast<GBA*>(thread->core->board);
GBASIOLockstepNode* node = new GBASIOLockstepNode;
@ -259,6 +259,10 @@ bool MultiplayerController::attachGame(CoreController* controller) {
#endif
#ifdef M_CORE_GB
case mPLATFORM_GB: {
if (m_lockstep.attached >= 2) {
return false;
}
GB* gb = static_cast<GB*>(thread->core->board);
GBSIOLockstepNode* node = new GBSIOLockstepNode;