From 002aa807c55f6d28bbe36ed09bbc55d4dc6ce3ce Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Wed, 2 Jan 2013 03:44:42 +0000 Subject: [PATCH] - 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) --- src/intermission/intermission.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/intermission/intermission.cpp b/src/intermission/intermission.cpp index 5d4ca5c06..4ac79f36e 100644 --- a/src/intermission/intermission.cpp +++ b/src/intermission/intermission.cpp @@ -589,18 +589,22 @@ void DIntermissionScreenCast::Drawer () // draw the current frame in the middle of the screen if (caststate != NULL) { - int castsprite; + int castsprite = caststate->sprite; if (!(mDefaults->flags4 & MF4_NOSKIN) && mDefaults->SpawnState != NULL && caststate->sprite == mDefaults->SpawnState->sprite && mClass->IsDescendantOf(RUNTIME_CLASS(APlayerPawn)) && skins != NULL) { - castsprite = skins[players[consoleplayer].userinfo.skin].sprite; - } - else - { - castsprite = caststate->sprite; + // Only use the skin sprite if this class has not been removed from the + // PlayerClasses list. + for (unsigned i = 0; i < PlayerClasses.Size(); ++i) + { + if (PlayerClasses[i].Type == mClass) + { + castsprite = skins[players[consoleplayer].userinfo.skin].sprite; + } + } } sprframe = &SpriteFrames[sprites[castsprite].spriteframes + caststate->GetFrame()];