From 66c85ec71fd75db1a9158993cbc114f2245a8119 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sat, 17 Jun 2017 11:42:12 +0000 Subject: [PATCH] Don't print any warnings to the log if an unrecognized gamefunc is dispatched; this is expected and normal when they are renamed. git-svn-id: https://svn.eduke32.com/eduke32@6188 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/osd.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/build/src/osd.cpp b/source/build/src/osd.cpp index 93779a41d..865604a5f 100644 --- a/source/build/src/osd.cpp +++ b/source/build/src/osd.cpp @@ -1816,7 +1816,12 @@ int32_t OSD_Dispatch(const char *cmd) if ((symb = findexactsymbol(wp)) == NULL) { - if ((wp[0] != '/' || wp[1] != '/') && !m32_osd_tryscript) // cheap hack for comments in cfgs + static char const s_gamefunc_[] = "gamefunc_"; + size_t const strlen_gamefunc_ = ARRAY_SIZE(s_gamefunc_)-1; + size_t const strlen_wp = Bstrlen(wp); + if ((wp[0] != '/' || wp[1] != '/') && // cheap hack for comments in cfgs + (strlen_gamefunc_ >= strlen_wp || Bstrncmp(wp, s_gamefunc_, strlen_gamefunc_)) && + !m32_osd_tryscript) { OSD_Printf(OSDTEXT_RED "\"%s\" is not a valid command or cvar\n", wp); }