From a5a4c3c32430f540463de03d99277334d4bd934e Mon Sep 17 00:00:00 2001 From: MysterD Date: Fri, 16 Oct 2020 22:22:28 -0700 Subject: [PATCH] Make gControllers respect MAX_PLAYERS fixes Linux crash when MAX_PLAYERS is increased --- src/game/game_init.c | 2 +- src/game/game_init.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/game_init.c b/src/game/game_init.c index 100df497..8a5c1018 100644 --- a/src/game/game_init.c +++ b/src/game/game_init.c @@ -28,7 +28,7 @@ // FIXME: I'm not sure all of these variables belong in this file, but I don't // know of a good way to split them -struct Controller gControllers[3]; +struct Controller gControllers[MAX_PLAYERS]; struct SPTask *gGfxSPTask; Gfx *gDisplayListHead; u8 *gGfxPoolEnd; diff --git a/src/game/game_init.h b/src/game/game_init.h index 15f48bb3..b452577a 100644 --- a/src/game/game_init.h +++ b/src/game/game_init.h @@ -22,7 +22,7 @@ struct DemoInput u8 buttonMask; }; -extern struct Controller gControllers[3]; +extern struct Controller gControllers[MAX_PLAYERS]; extern OSContStatus gControllerStatuses[4]; extern OSContPad gControllerPads[4]; extern OSMesgQueue gGameVblankQueue;