quake2ts 0.0.261 → 0.0.263

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1009,7 +1009,14 @@ var applyPmove = (state, cmd, trace, pointContents2) => {
1009
1009
  let newState = { ...state };
1010
1010
  newState = categorizePosition2(newState, trace);
1011
1011
  newState = checkWater(newState, pointContents2);
1012
- const { origin, velocity, onGround, waterLevel } = newState;
1012
+ const { origin, velocity, onGround, waterLevel, viewAngles } = newState;
1013
+ const adjustedAngles = waterLevel >= 2 ? viewAngles : {
1014
+ // For ground/air movement, reduce pitch influence (rerelease/p_move.cpp:1689)
1015
+ x: viewAngles.x > 180 ? (viewAngles.x - 360) / 3 : viewAngles.x / 3,
1016
+ y: viewAngles.y,
1017
+ z: viewAngles.z
1018
+ };
1019
+ const { forward, right } = angleVectors(adjustedAngles);
1013
1020
  const frictionedVelocity = applyPmoveFriction({
1014
1021
  velocity,
1015
1022
  frametime: FRAMETIME,
@@ -1022,13 +1029,13 @@ var applyPmove = (state, cmd, trace, pointContents2) => {
1022
1029
  pmWaterFriction: 1
1023
1030
  });
1024
1031
  const wish = waterLevel >= 2 ? buildWaterWish({
1025
- forward: { x: 1, y: 0, z: 0 },
1026
- right: { x: 0, y: 1, z: 0 },
1032
+ forward,
1033
+ right,
1027
1034
  cmd,
1028
1035
  maxSpeed: 320
1029
1036
  }) : buildAirGroundWish({
1030
- forward: { x: 1, y: 0, z: 0 },
1031
- right: { x: 0, y: 1, z: 0 },
1037
+ forward,
1038
+ right,
1032
1039
  cmd,
1033
1040
  maxSpeed: 320
1034
1041
  });