- fixed some crash issues with recent changes.

This commit is contained in:
Christoph Oelckers 2016-06-18 10:01:24 +02:00
parent 92e2ce2aef
commit 87d27b8db3
2 changed files with 6 additions and 2 deletions

View file

@ -1077,8 +1077,12 @@ void gl_RenderHUDModel(DPSprite *psp, float ofsX, float ofsY)
bool gl_IsHUDModelForPlayerAvailable (player_t * player) bool gl_IsHUDModelForPlayerAvailable (player_t * player)
{ {
if (player == nullptr || player->ReadyWeapon == nullptr)
return false;
DPSprite *psp = player->FindPSprite(PSP_WEAPON); DPSprite *psp = player->FindPSprite(PSP_WEAPON);
if ( (player == nullptr) || (player->ReadyWeapon == nullptr) || (psp->GetState() == nullptr) )
if (psp == nullptr || psp->GetState() == nullptr)
return false; return false;
FState* state = psp->GetState(); FState* state = psp->GetState();

View file

@ -240,7 +240,7 @@ void GLSprite::Draw(int pass)
secplane_t *lowplane = i == (*lightlist).Size() - 1 ? &bottomp : &(*lightlist)[i + 1].plane; secplane_t *lowplane = i == (*lightlist).Size() - 1 ? &bottomp : &(*lightlist)[i + 1].plane;
int thislight = (*lightlist)[i].caster != NULL ? gl_ClampLight(*(*lightlist)[i].p_lightlevel) : lightlevel; int thislight = (*lightlist)[i].caster != NULL ? gl_ClampLight(*(*lightlist)[i].p_lightlevel) : lightlevel;
int thisll = (byte)gl_CheckSpriteGlow(actor->Sector, thislight, actor->InterpolatedPosition(r_TicFracF)); int thisll = actor == nullptr? thislight : (uint8_t)gl_CheckSpriteGlow(actor->Sector, thislight, actor->InterpolatedPosition(r_TicFracF));
FColormap thiscm; FColormap thiscm;
thiscm.FadeColor = Colormap.FadeColor; thiscm.FadeColor = Colormap.FadeColor;