mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-27 06:12:19 +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)
|
void R_RebuildViewInterpolation(player_t *player)
|
||||||
{
|
{
|
||||||
InterpolationViewer *iview;
|
if (player == NULL || player->camera == NULL)
|
||||||
if (NoInterpolateView)
|
return;
|
||||||
{
|
|
||||||
if (player != NULL && player->camera != NULL)
|
|
||||||
{
|
|
||||||
iview = FindPastViewer(player->camera);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (iview == NULL)
|
if (!NoInterpolateView)
|
||||||
return;
|
return;
|
||||||
|
NoInterpolateView = false;
|
||||||
|
|
||||||
NoInterpolateView = false;
|
InterpolationViewer *iview = FindPastViewer(player->camera);
|
||||||
iview->oviewx = iview->nviewx;
|
|
||||||
iview->oviewy = iview->nviewy;
|
iview->oviewx = iview->nviewx;
|
||||||
iview->oviewz = iview->nviewz;
|
iview->oviewy = iview->nviewy;
|
||||||
iview->oviewpitch = iview->nviewpitch;
|
iview->oviewz = iview->nviewz;
|
||||||
iview->oviewangle = iview->nviewangle;
|
iview->oviewpitch = iview->nviewpitch;
|
||||||
}
|
iview->oviewangle = iview->nviewangle;
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
Loading…
Reference in a new issue