mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 15:02:39 +00:00
Merge branch 'viewpitch_overflow_fix' of https://github.com/edward-san/zdoom into maint
This commit is contained in:
commit
9a74f96702
2 changed files with 4 additions and 4 deletions
|
@ -775,7 +775,7 @@ void G_AddViewPitch (int look)
|
|||
else if (look > 0)
|
||||
{
|
||||
// Avoid overflowing
|
||||
if (LocalViewPitch + look <= LocalViewPitch)
|
||||
if (LocalViewPitch > INT_MAX - look)
|
||||
{
|
||||
LocalViewPitch = 0x78000000;
|
||||
}
|
||||
|
@ -787,7 +787,7 @@ void G_AddViewPitch (int look)
|
|||
else if (look < 0)
|
||||
{
|
||||
// Avoid overflowing
|
||||
if (LocalViewPitch + look >= LocalViewPitch)
|
||||
if (LocalViewPitch < INT_MIN - look)
|
||||
{
|
||||
LocalViewPitch = -0x78000000;
|
||||
}
|
||||
|
|
|
@ -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…
Reference in a new issue