Mapster32: make 'script_expertmode' require an argument (0 or 1) to toggle.

Without an argument, it prints the current state.

git-svn-id: https://svn.eduke32.com/eduke32@5432 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2015-11-20 20:26:49 +00:00
parent f98af5622a
commit 56672fd5e2

View file

@ -8596,11 +8596,14 @@ static int32_t osdcmd_vars_pk(const osdfuncparm_t *parm)
if (!Bstrcasecmp(parm->name, "script_expertmode"))
{
m32_script_expertmode = !m32_script_expertmode;
if (setval)
m32_script_expertmode = !!atoi_safe(parm->parms[0]);
if (m32_script_expertmode)
OSD_Printf("M32 Script expert mode ENABLED. Be sure to know what you are doing!\n");
OSD_Printf("M32 Script expert mode %sENABLED. Be sure to know what you are doing!\n",
setval ? "" : "is ");
else
OSD_Printf("M32 Script expert mode DISABLED.\n");
OSD_Printf("M32 Script expert mode %sDISABLED.\n", setval ? "" : "is ");
return OSDCMD_OK;
}