Skip to content

Commit

Permalink
Codechange: Don't use a magic number for the number of DiagDirections
Browse files Browse the repository at this point in the history
  • Loading branch information
2TallTyler committed Nov 1, 2023
1 parent a48cc7b commit 2eb614d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/town_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ static TownDrawTileProc * const _town_draw_tile_procs[1] = {
*/
static inline DiagDirection RandomDiagDir()
{
return (DiagDirection)(3 & Random());
return (DiagDirection)(Random() & DIAGDIR_END - 1);
}

/**
Expand Down

0 comments on commit 2eb614d

Please sign in to comment.