Add MOD to match mod with powers of 2
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
#include "constants/moves.h"
|
||||
#include "constants/trainers.h"
|
||||
|
||||
#define NUM_LAYOUT_OFFSETS 8 // Assumed to be a power of 2
|
||||
#define NUM_LAYOUT_OFFSETS 8
|
||||
|
||||
extern const struct MapLayout *const gMapLayouts[];
|
||||
|
||||
@@ -1904,7 +1904,7 @@ static void GetPyramidFloorLayoutOffsets(u8 *layoutOffsets)
|
||||
|
||||
for (i = 0; i < NUM_PYRAMID_FLOOR_SQUARES; i++)
|
||||
{
|
||||
layoutOffsets[i] = sPyramidFloorTemplates[id].layoutOffsets[rand & (NUM_LAYOUT_OFFSETS - 1)];
|
||||
layoutOffsets[i] = sPyramidFloorTemplates[id].layoutOffsets[MOD(rand, NUM_LAYOUT_OFFSETS)];
|
||||
rand >>= 3;
|
||||
if (i == 7)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user