- Fixed: Don't use the player skin in the cast call if the class being shown has been removed

from the PlayerClasses array (and therefore does not have a valid default skin).

SVN r4010 (trunk)
This commit is contained in:
Randy Heit 2013-01-02 03:44:42 +00:00
parent ca2d75307c
commit 002aa807c5

View file

@ -589,18 +589,22 @@ void DIntermissionScreenCast::Drawer ()
// draw the current frame in the middle of the screen // draw the current frame in the middle of the screen
if (caststate != NULL) if (caststate != NULL)
{ {
int castsprite; int castsprite = caststate->sprite;
if (!(mDefaults->flags4 & MF4_NOSKIN) && if (!(mDefaults->flags4 & MF4_NOSKIN) &&
mDefaults->SpawnState != NULL && caststate->sprite == mDefaults->SpawnState->sprite && mDefaults->SpawnState != NULL && caststate->sprite == mDefaults->SpawnState->sprite &&
mClass->IsDescendantOf(RUNTIME_CLASS(APlayerPawn)) && mClass->IsDescendantOf(RUNTIME_CLASS(APlayerPawn)) &&
skins != NULL) skins != NULL)
{ {
castsprite = skins[players[consoleplayer].userinfo.skin].sprite; // Only use the skin sprite if this class has not been removed from the
} // PlayerClasses list.
else for (unsigned i = 0; i < PlayerClasses.Size(); ++i)
{ {
castsprite = caststate->sprite; if (PlayerClasses[i].Type == mClass)
{
castsprite = skins[players[consoleplayer].userinfo.skin].sprite;
}
}
} }
sprframe = &SpriteFrames[sprites[castsprite].spriteframes + caststate->GetFrame()]; sprframe = &SpriteFrames[sprites[castsprite].spriteframes + caststate->GetFrame()];