mirror of
https://github.com/afska/gba-link-connection.git
synced 2026-10-01 13:27:18 -05:00
playerCount() cannot be greater than LINK_UNIVERSAL_MAX_PLAYERS
This commit is contained in:
@@ -197,8 +197,9 @@ class LinkUniversal {
|
||||
* @brief Returns the number of connected players (`1~5`).
|
||||
*/
|
||||
[[nodiscard]] u8 playerCount() {
|
||||
return mode == Mode::LINK_CABLE ? linkCable.playerCount()
|
||||
: linkWireless.playerCount();
|
||||
return Link::_min(mode == Mode::LINK_CABLE ? linkCable.playerCount()
|
||||
: linkWireless.playerCount(),
|
||||
LINK_UNIVERSAL_MAX_PLAYERS);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user