diff --git a/src/g_shared/sbar.h b/src/g_shared/sbar.h index 560a7500a5..03901f66fd 100644 --- a/src/g_shared/sbar.h +++ b/src/g_shared/sbar.h @@ -264,6 +264,7 @@ class FMugShot DISABLEOUCH = 0x8, DISABLEPAIN = 0x10, DISABLERAMPAGE = 0x20, + CUSTOM = 0x40, }; FMugShot(); diff --git a/src/g_shared/sbar_mugshot.cpp b/src/g_shared/sbar_mugshot.cpp index b26541c99d..148b7cb329 100644 --- a/src/g_shared/sbar_mugshot.cpp +++ b/src/g_shared/sbar_mugshot.cpp @@ -489,7 +489,7 @@ FTexture *FMugShot::GetFace(player_t *player, const char *default_face, int accu if (CurrentState != NULL) { int skin = player->userinfo.GetSkin(); - const char *skin_face = player->morphTics ? player->MorphedPlayerClass->Face.GetChars() : skins[skin].face; + const char *skin_face = (stateflags & FMugShot::CUSTOM) ? nullptr : (player->morphTics ? player->MorphedPlayerClass->Face.GetChars() : skins[skin].face); return CurrentState->GetCurrentFrameTexture(default_face, skin_face, level, angle); } return NULL; diff --git a/src/g_shared/sbarinfo_commands.cpp b/src/g_shared/sbarinfo_commands.cpp index 26b4c95101..854cb4106f 100644 --- a/src/g_shared/sbarinfo_commands.cpp +++ b/src/g_shared/sbarinfo_commands.cpp @@ -1578,23 +1578,25 @@ class CommandDrawMugShot : public SBarInfoCommand sc.ScriptError("Expected a number between 1 and 9, got %d instead.", sc.Number); accuracy = sc.Number; sc.MustGetToken(','); - while(sc.CheckToken(TK_Identifier)) + while (sc.CheckToken(TK_Identifier)) { - if(sc.Compare("xdeathface")) - stateFlags = static_cast (stateFlags|FMugShot::XDEATHFACE); - else if(sc.Compare("animatedgodmode")) - stateFlags = static_cast (stateFlags|FMugShot::ANIMATEDGODMODE); - else if(sc.Compare("disablegrin")) - stateFlags = static_cast (stateFlags|FMugShot::DISABLEGRIN); - else if(sc.Compare("disableouch")) - stateFlags = static_cast (stateFlags|FMugShot::DISABLEOUCH); - else if(sc.Compare("disablepain")) - stateFlags = static_cast (stateFlags|FMugShot::DISABLEPAIN); - else if(sc.Compare("disablerampage")) - stateFlags = static_cast (stateFlags|FMugShot::DISABLERAMPAGE); + if (sc.Compare("xdeathface")) + stateFlags = static_cast (stateFlags | FMugShot::XDEATHFACE); + else if (sc.Compare("animatedgodmode")) + stateFlags = static_cast (stateFlags | FMugShot::ANIMATEDGODMODE); + else if (sc.Compare("disablegrin")) + stateFlags = static_cast (stateFlags | FMugShot::DISABLEGRIN); + else if (sc.Compare("disableouch")) + stateFlags = static_cast (stateFlags | FMugShot::DISABLEOUCH); + else if (sc.Compare("disablepain")) + stateFlags = static_cast (stateFlags | FMugShot::DISABLEPAIN); + else if (sc.Compare("disablerampage")) + stateFlags = static_cast (stateFlags | FMugShot::DISABLERAMPAGE); + else if (sc.Compare("custom")) + stateFlags = static_cast (stateFlags | FMugShot::CUSTOM); else sc.ScriptError("Unknown flag '%s'.", sc.String); - if(!sc.CheckToken('|')) + if (!sc.CheckToken('|')) sc.MustGetToken(','); }