Skip to content

Commit

Permalink
Running/crouching while swimming will result in faster/slower swim sp…
Browse files Browse the repository at this point in the history
…eed (#34770)

* Running movement mode while swimming means faster swim speed

* Swimming speed is now based on movement mode
  • Loading branch information
Night-Pryanik authored and ZhilkinSerg committed Oct 15, 2019
1 parent bb3361e commit 31ecb67
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1768,6 +1768,16 @@ int player::swim_speed() const
if( underwater && ret < 500 ) {
ret -= 50;
}

// Running movement mode while swimming means faster swim style, like crawlstroke
if( move_mode == PMM_RUN ) {
ret -= 80;
}
// Crouching movement mode while swimming means slower swim style, like breaststroke
if( move_mode == PMM_CROUCH ) {
ret += 50;
}

if( ret < 30 ) {
ret = 30;
}
Expand Down

0 comments on commit 31ecb67

Please sign in to comment.