Skip to content

Commit

Permalink
use clamp() for limit the randomness, as @pehamm suggested
Browse files Browse the repository at this point in the history
  • Loading branch information
Tairesh committed Jun 12, 2021
1 parent cda8d5e commit 57e9b97
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,9 @@ void Character::randomize_height()
{
// Height distribution data is taken from this paper:
// http://www.biostat.jhsph.edu/bstcourse/bio751/papers/bimodalHeight.pdf
init_height = round( male ? normal_roll( 176.0, 7.4 ) : normal_roll( 162.8, 7.0 ) );
// clamping to 145..200 because this is the bounds of what player can set, see newplayer.cpp
init_height = clamp( static_cast< int >( round( male ? normal_roll( 176.0, 7.4 ) : normal_roll( 162.8, 7.0 ) ) ),
145, 200 );
}

void Character::randomize_blood()
Expand Down

0 comments on commit 57e9b97

Please sign in to comment.