1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-28 09:14:58 +01:00

Apply review suggestions

This commit is contained in:
Matt
2021-02-20 13:49:50 +02:00
parent 62baee3adb
commit 571bf0dab1
4 changed files with 14 additions and 17 deletions

View File

@@ -155,15 +155,15 @@ static int32_t peep_move_one_tile(Direction direction, Peep* peep)
if (direction == 0 || direction == 2)
{
// Peep is moving along X, so apply the offset to the X position of the destination and clamp their current Y
const int32_t centerLine = (peep->y & 0xFFE0) + COORDS_XY_HALF_TILE;
const int32_t centreLine = (peep->y & 0xFFE0) + COORDS_XY_HALF_TILE;
newTile.x += offset;
newTile.y = std::clamp<int32_t>(peep->y, centerLine - 3, centerLine + 3);
newTile.y = std::clamp<int32_t>(peep->y, centreLine - 3, centreLine + 3);
}
else
{
// Peep is moving along Y, so apply the offset to the Y position of the destination and clamp their current X
const int32_t centerLine = (peep->x & 0xFFE0) + COORDS_XY_HALF_TILE;
newTile.x = std::clamp<int32_t>(peep->x, centerLine - 3, centerLine + 3);
const int32_t centreLine = (peep->x & 0xFFE0) + COORDS_XY_HALF_TILE;
newTile.x = std::clamp<int32_t>(peep->x, centreLine - 3, centreLine + 3);
newTile.y += offset;
}
}