8000 mint-arena: Avoid overbounce in PM_WaterMove · Turtle-Arena/turtle-arena-code@3a41eba · GitHub
[go: up one dir, main page]

Skip to content

Commit 3a41eba

Browse files
committed
mint-arena: Avoid overbounce in PM_WaterMove
Apply my changes for avoiding overbounce from PM_WalkMove to PM_WaterMove. I didn't think overbounce was likely to happen there but applied the change because Tobias Kuehnhammer did in his ioqw project.
1 parent cac7d15 commit 3a41eba

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

code/game/bg_pmove.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,11 @@ static void PM_WaterMove( void ) {
534534
PM_ClipVelocity (pm->ps->velocity, pml.groundTrace.plane.normal,
535535
pm->ps->velocity, OVERCLIP );
536536

537-
VectorNormalize(pm->ps->velocity);
538-
VectorScale(pm->ps->velocity, vel, pm->ps->velocity);
537+
// don't decrease velocity when going up or down a slope
538+
if ( pm->pmove_overbounce || VectorLength(pm->ps->velocity) > 1 ) {
539+
VectorNormalize(pm->ps->velocity);
540+
VectorScale(pm->ps->velocity, vel, pm->ps->velocity);
541+
}
539542
}
540543

541544
PM_SlideMove( qfalse );
@@ -800,8 +803,8 @@ static void PM_WalkMove( void ) {
800803
PM_ClipVelocity (pm->ps->velocity, pml.groundTrace.plane.normal,
801804
pm->ps->velocity, OVERCLIP );
802805

806+
// don't decrease velocity when going up or down a slope
803807
if ( pm->pmove_overbounce || VectorLength(pm->ps->velocity) > 1 ) {
804-
// don't decrease velocity when going up or down a slope
805808
VectorNormalize(pm->ps->velocity);
806809
VectorScale(pm->ps->velocity, vel, pm->ps->velocity);
807810
}

0 commit comments

Comments
 (0)
0