MD2's replacing skinned mobj fix

MD2's that replace mobjs that have a skin, but the skin doesn't have an
MD2 now display.
This commit is contained in:
Sryder13 2014-03-19 23:40:02 +00:00
parent ba0c93d814
commit 2b80874646

View file

@ -3836,7 +3836,7 @@ static void HWR_DrawSprites(void)
HWR_DrawPrecipitationSprite(spr); HWR_DrawPrecipitationSprite(spr);
else else
#endif #endif
if (spr->mobj->skin) if (spr->mobj && spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
{ {
if (!cv_grmd2.value || (cv_grmd2.value && md2_playermodels[(skin_t*)spr->mobj->skin-skins].notfound == true)) if (!cv_grmd2.value || (cv_grmd2.value && md2_playermodels[(skin_t*)spr->mobj->skin-skins].notfound == true))
HWR_DrawSprite(spr); HWR_DrawSprite(spr);
@ -3865,7 +3865,7 @@ static void HWR_DrawMD2S(void)
if (!spr->precip) if (!spr->precip)
{ {
#endif #endif
if (spr->mobj && spr->mobj->skin) if (spr->mobj && spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
{ {
if ((md2_playermodels[(skin_t*)spr->mobj->skin-skins].notfound == false) && (md2_playermodels[(skin_t*)spr->mobj->skin-skins].scale > 0.0f)) if ((md2_playermodels[(skin_t*)spr->mobj->skin-skins].notfound == false) && (md2_playermodels[(skin_t*)spr->mobj->skin-skins].scale > 0.0f))
HWR_DrawMD2(spr); HWR_DrawMD2(spr);