diff --git a/src/command.c b/src/command.c index f87794346..44454ce50 100644 --- a/src/command.c +++ b/src/command.c @@ -1161,7 +1161,11 @@ found: else { if (var == &cv_forceskin) + { var->value = R_SkinAvailable(var->string); + if (!R_SkinUnlock(var->value)) + var->value = -1; + } else var->value = atoi(var->string); } diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 21008cbcf..65b415e65 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -4002,17 +4002,10 @@ static void Command_Archivetest_f(void) */ static void ForceSkin_OnChange(void) { - if ((server || adminplayer == consoleplayer) && (cv_forceskin.value < -1 || cv_forceskin.value >= numskins || !(dedicated || R_SkinUnlock(cv_forceskin.value)))) // Dedicated servers have everything when it comes to forceskin because they have no gamedata. + if ((server || adminplayer == consoleplayer) && ((cv_forceskin.value == -1 && stricmp(cv_forceskin.string, "None")) || !(R_SkinUnlock(cv_forceskin.value)))) { - if (cv_forceskin.value == -2) - CV_SetValue(&cv_forceskin, numskins-1); - else - { - // hack because I can't restrict this and still allow added skins to be used with forceskin. - if (!menuactive) - CONS_Printf(M_GetText("Valid skin numbers are 0 to %d (-1 disables)\n"), numskins - 1); - CV_SetValue(&cv_forceskin, -1); - } + CONS_Printf("Please provide a valid skin name (\"None\" disables).\n"); + CV_SetValue(&cv_forceskin, -1); return; } @@ -4024,7 +4017,7 @@ static void ForceSkin_OnChange(void) CONS_Printf("The server has lifted the forced skin restrictions.\n"); else { - CONS_Printf("The server is restricting all players to skin \"%s\".\n",skins[cv_forceskin.value].name); + CONS_Printf("The server is restricting all players to skin \"%s\".\n",skins[cv_forceskin.value].realname); ForceAllSkins(cv_forceskin.value); } } diff --git a/src/locale/en.po b/src/locale/en.po index 2665082a2..069930b81 100644 --- a/src/locale/en.po +++ b/src/locale/en.po @@ -1377,11 +1377,6 @@ msgstr "" msgid "modifiedgame is false, you can unlock secrets\n" msgstr "" -#: d_netcmd.c:4599 -#, c-format -msgid "Valid skin numbers are 0 to %d (-1 disables)\n" -msgstr "" - #: d_netcmd.c:4617 d_netcmd.c:4629 msgid "You may not change your name when chat is muted.\n" msgstr "" diff --git a/src/locale/srb2.pot b/src/locale/srb2.pot index 37d14f8b7..ced13bbe6 100644 --- a/src/locale/srb2.pot +++ b/src/locale/srb2.pot @@ -1362,11 +1362,6 @@ msgstr "" msgid "No CHEAT-marked variables are changed -- Cheats are disabled.\n" msgstr "" -#: d_netcmd.c:4439 -#, c-format -msgid "Valid skin numbers are 0 to %d (-1 disables)\n" -msgstr "" - #: d_netcmd.c:4457 d_netcmd.c:4469 msgid "You may not change your name when chat is muted.\n" msgstr "" diff --git a/src/r_things.c b/src/r_things.c index 6aa196583..0167f43b5 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2346,7 +2346,7 @@ boolean R_SkinUnlock(INT32 skinnum) || (skins[skinnum].availability) || (modeattacking) // If you have someone else's run you might as well take a look || (Playing() && (R_SkinAvailable(mapheaderinfo[gamemap-1]->forcecharacter) == skinnum)) // Force 1. - || ((netgame) && (cv_forceskin.value == skinnum)) // Force 2. + || (netgame && !(server || adminplayer == consoleplayer) && (cv_forceskin.value == skinnum)) // Force 2. ); }