Skip to content

Commit

Permalink
Add ApplyAirControl
Browse files Browse the repository at this point in the history
  • Loading branch information
jekyllgrim authored and RicardoLuis0 committed Apr 16, 2024
1 parent 7c93cfa commit 0055042
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions wadsrc/static/zscript/actors/player/player.zs
Expand Up @@ -1263,6 +1263,12 @@ class PlayerPawn : Actor
return forward, side;
}

virtual void ApplyAirControl(out double movefactor, out double bobfactor)
{
movefactor *= level.aircontrol;
bobfactor *= level.aircontrol;
}

//----------------------------------------------------------------------------
//
// PROC P_MovePlayer
Expand Down Expand Up @@ -1306,8 +1312,8 @@ class PlayerPawn : Actor
if (!player.onground && !bNoGravity && !waterlevel)
{
// [RH] allow very limited movement if not on ground.
movefactor *= level.aircontrol;
bobfactor*= level.aircontrol;
// [AA] but also allow authors to override it.
ApplyAirControl(movefactor, bobfactor);
}

fm = cmd.forwardmove;
Expand Down

0 comments on commit 0055042

Please sign in to comment.