From 56672fd5e27b0bad9195e8b07106f89cea9b365c Mon Sep 17 00:00:00 2001 From: helixhorned Date: Fri, 20 Nov 2015 20:26:49 +0000 Subject: [PATCH] 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 --- polymer/eduke32/source/astub.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 17b3ebc1f..2792f6756 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -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; }