fix: Don't allow select MULTI_TRAINER if no MULTI (#2299)

* fix: Don't allow select MULTI_TRAINER if no MULTI
Fixes #1563 by ensuring Multi Trainer opt is not shown if no MPM
is enabled, as well as if MPM suport is not even compiled in.

* chore: Uppercase "OFF" or equiv for Trainer OFF
This commit is contained in:
Peter Feerick
2022-09-14 12:34:43 +10:00
committed by GitHub
parent d9c7cfae6f
commit d54e656608
5 changed files with 16 additions and 5 deletions
+12 -1
View File
@@ -882,7 +882,18 @@ bool isTrainerModeAvailable(int mode)
mode == TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE))
return false;
#endif
#if !defined(MULTIMODULE)
if (mode == TRAINER_MODE_MULTI)
return false;
#else
if (mode == TRAINER_MODE_MULTI &&
((!IS_INTERNAL_MODULE_ENABLED() && !IS_EXTERNAL_MODULE_ENABLED()) ||
(!isModuleMultimodule(INTERNAL_MODULE) &&
!isModuleMultimodule(EXTERNAL_MODULE))))
return false;
#endif
return true;
}