From b60e2a57dc1ac05274f978cce72e22efbf8f0672 Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 29 Jun 2008 12:53:18 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@814 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/src/osd.c | 6 ++++++ polymer/eduke32/source/game.c | 3 +++ polymer/eduke32/source/osdcmds.c | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/polymer/build/src/osd.c b/polymer/build/src/osd.c index 5ff0c482b..c61fc5ab2 100644 --- a/polymer/build/src/osd.c +++ b/polymer/build/src/osd.c @@ -1140,6 +1140,12 @@ int OSD_Dispatch(const char *cmd) continue; } + if (wp[0] == '/' && wp[1] == '/') // cheap hack + { + free(workbuf); + return -1; + } + symb = findexactsymbol(wp); if (!symb) { diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 1c251892f..ca924e8b8 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -7814,10 +7814,13 @@ int load_script(const char *szScript) if (fp != NULL) { char line[255]; + extern int cmdfromscript; OSD_Printf("Executing \"%s\"\n", szScript); + cmdfromscript = 1; while (fgets(line ,sizeof(line)-1, fp) != NULL) OSD_Dispatch(strtok(line,"\r\n")); + cmdfromscript = 0; fclose(fp); return 0; } diff --git a/polymer/eduke32/source/osdcmds.c b/polymer/eduke32/source/osdcmds.c index 5b579cec1..ff32af161 100644 --- a/polymer/eduke32/source/osdcmds.c +++ b/polymer/eduke32/source/osdcmds.c @@ -32,6 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern int voting; struct osdcmd_cheatsinfo osdcmd_cheatsinfo_stat; +int cmdfromscript = 0; static inline int osdcmd_quit(const osdfuncparm_t *parm) { @@ -999,7 +1000,8 @@ static int osdcmd_bind(const osdfuncparm_t *parm) else boundkeys[keynames[i].id].repeat = 1; Bstrncpy(boundkeys[keynames[i].id].name,parm->parms[j], MAXBINDSTRINGLENGTH-1); boundkeys[keynames[i].id].key=keynames[i].name; - OSD_Printf("%s\n",parm->raw); + if (!cmdfromscript) + OSD_Printf("%s\n",parm->raw); return OSDCMD_OK; }