- Fixed overflow checking in some viewpitch code
This commit is contained in:
parent
2501dc6df6
commit
884928687d
2 changed files with 4 additions and 4 deletions
|
|
@ -602,7 +602,7 @@ void R_InterpolateView (player_t *player, fixed_t frac, InterpolationViewer *ivi
|
|||
if (delta > 0)
|
||||
{
|
||||
// Avoid overflowing viewpitch (can happen when a netgame is stalled)
|
||||
if (viewpitch + delta <= viewpitch)
|
||||
if (viewpitch > INT_MAX - delta)
|
||||
{
|
||||
viewpitch = player->MaxPitch;
|
||||
}
|
||||
|
|
@ -614,7 +614,7 @@ void R_InterpolateView (player_t *player, fixed_t frac, InterpolationViewer *ivi
|
|||
else if (delta < 0)
|
||||
{
|
||||
// Avoid overflowing viewpitch (can happen when a netgame is stalled)
|
||||
if (viewpitch + delta >= viewpitch)
|
||||
if (viewpitch < INT_MIN - delta)
|
||||
{
|
||||
viewpitch = player->MinPitch;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue