mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-03-19 12:08:34 +01:00
Use the TILESET_WIDTH constant in rotating_tile_puzzle.c
This commit is contained in:
parent
120e75d275
commit
0637910f58
@ -134,14 +134,14 @@ u16 MoveRotatingTileObjects(u8 puzzleNumber)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Object is on a metatile after the puzzle tile section (never occurs, in both cases the puzzle tiles are last)
|
// Object is on a metatile after the puzzle tile section (never occurs, in both cases the puzzle tiles are last)
|
||||||
if ((u8)((metatile - puzzleTileStart) / 8) >= 5)
|
if ((u8)((metatile - puzzleTileStart) / TILESET_WIDTH) >= 5)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Object is on a metatile in puzzle tile section, but not one of the currently rotating color
|
// Object is on a metatile in puzzle tile section, but not one of the currently rotating color
|
||||||
if ((u8)((metatile - puzzleTileStart) / 8) != puzzleNumber)
|
if ((u8)((metatile - puzzleTileStart) / TILESET_WIDTH) != puzzleNumber)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
puzzleTileNum = (u8)((metatile - puzzleTileStart) % 8);
|
puzzleTileNum = (u8)((metatile - puzzleTileStart) % TILESET_WIDTH);
|
||||||
|
|
||||||
// First 4 puzzle tiles are the colored arrows
|
// First 4 puzzle tiles are the colored arrows
|
||||||
if (puzzleTileNum < 4)
|
if (puzzleTileNum < 4)
|
||||||
@ -221,7 +221,7 @@ void TurnRotatingTileObjects(void)
|
|||||||
// prevPuzzleTileNum will similarly be a number [0-3] representing the arrow tile the object just moved from
|
// prevPuzzleTileNum will similarly be a number [0-3] representing the arrow tile the object just moved from
|
||||||
// All the puzzles are oriented counter-clockwise and can only move 1 step at a time, so the difference between the current tile and the previous tile will always either be -1 or 3 (0-1, 1-2, 2-3, 3-0)
|
// All the puzzles are oriented counter-clockwise and can only move 1 step at a time, so the difference between the current tile and the previous tile will always either be -1 or 3 (0-1, 1-2, 2-3, 3-0)
|
||||||
// Which means tileDifference will always either be -1 or 3 after the below subtraction, and rotation will always be ROTATE_COUNTERCLOCKWISE after the following conditionals
|
// Which means tileDifference will always either be -1 or 3 after the below subtraction, and rotation will always be ROTATE_COUNTERCLOCKWISE after the following conditionals
|
||||||
tileDifference = (u8)((metatile - puzzleTileStart) % 8);
|
tileDifference = (u8)((metatile - puzzleTileStart) % TILESET_WIDTH);
|
||||||
tileDifference -= (sRotatingTilePuzzle->objects[i].prevPuzzleTileNum);
|
tileDifference -= (sRotatingTilePuzzle->objects[i].prevPuzzleTileNum);
|
||||||
|
|
||||||
// Always true, see above
|
// Always true, see above
|
||||||
@ -331,7 +331,7 @@ static void TurnUnsavedRotatingTileObject(u8 eventTemplateId, u8 puzzleTileNum)
|
|||||||
else
|
else
|
||||||
puzzleTileStart = METATILE_TrickHousePuzzle_Arrow_YellowOnWhite_Right;
|
puzzleTileStart = METATILE_TrickHousePuzzle_Arrow_YellowOnWhite_Right;
|
||||||
|
|
||||||
tileDifference = (u8)((metatile - puzzleTileStart) % 8);
|
tileDifference = (u8)((metatile - puzzleTileStart) % TILESET_WIDTH);
|
||||||
tileDifference -= puzzleTileNum;
|
tileDifference -= puzzleTileNum;
|
||||||
|
|
||||||
if (tileDifference < 0 || tileDifference == 3)
|
if (tileDifference < 0 || tileDifference == 3)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user