mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
- Fixed a possible uninitialized condition.
In the function R_RebuildViewInterpolation, the pointer 'iview' was not initialized when the player or its camera were NULL, hence 'iview == NULL' was garbage. Also, the function FindPastViewer does not return NULL, hence the mentioned check is not needed at all. Just return early if the player camera does not exist.
This commit is contained in:
parent
0f62983aee
commit
54ccf5d44d
1 changed files with 12 additions and 16 deletions
|
@ -737,24 +737,20 @@ void R_ClearPastViewer (AActor *actor)
|
|||
|
||||
void R_RebuildViewInterpolation(player_t *player)
|
||||
{
|
||||
InterpolationViewer *iview;
|
||||
if (NoInterpolateView)
|
||||
{
|
||||
if (player != NULL && player->camera != NULL)
|
||||
{
|
||||
iview = FindPastViewer(player->camera);
|
||||
}
|
||||
if (player == NULL || player->camera == NULL)
|
||||
return;
|
||||
|
||||
if (iview == NULL)
|
||||
return;
|
||||
if (!NoInterpolateView)
|
||||
return;
|
||||
NoInterpolateView = false;
|
||||
|
||||
NoInterpolateView = false;
|
||||
iview->oviewx = iview->nviewx;
|
||||
iview->oviewy = iview->nviewy;
|
||||
iview->oviewz = iview->nviewz;
|
||||
iview->oviewpitch = iview->nviewpitch;
|
||||
iview->oviewangle = iview->nviewangle;
|
||||
}
|
||||
InterpolationViewer *iview = FindPastViewer(player->camera);
|
||||
|
||||
iview->oviewx = iview->nviewx;
|
||||
iview->oviewy = iview->nviewy;
|
||||
iview->oviewz = iview->nviewz;
|
||||
iview->oviewpitch = iview->nviewpitch;
|
||||
iview->oviewangle = iview->nviewangle;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
Loading…
Reference in a new issue