From ba1ac9d89aca4b062d7dddd6703b083e82d7064a Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Thu, 28 Mar 2013 09:06:14 +0000 Subject: [PATCH] Load def modules even if no root def exists. Print a message to the log for each def module that is loaded. git-svn-id: https://svn.eduke32.com/eduke32@3621 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/defs.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/polymer/eduke32/build/src/defs.c b/polymer/eduke32/build/src/defs.c index 44ca8ca08..53c2829b1 100644 --- a/polymer/eduke32/build/src/defs.c +++ b/polymer/eduke32/build/src/defs.c @@ -122,6 +122,13 @@ static void defsparser_include(const char *fn, const scriptfile *script, const c } else { + if (!cmdtokptr) + { + flushlogwindow = 1; + initprintf("Loading module \"%s\"\n",fn); + flushlogwindow = 0; + } + defsparser(included); scriptfile_close(included); } @@ -2101,20 +2108,28 @@ int32_t loaddefinitionsfile(const char *fn) int32_t i; script = scriptfile_fromfile(fn); - if (!script) return -1; - flushlogwindow = 1; - initprintf("Loading \"%s\"\n",fn); - flushlogwindow = 0; - defsparser(script); + if (script) + { + flushlogwindow = 1; + initprintf("Loading \"%s\"\n",fn); + flushlogwindow = 0; + + defsparser(script); + } for (i=0; i < g_defModulesNum; ++i) defsparser_include(g_defModules[i], NULL, NULL); flushlogwindow = f; - scriptfile_close(script); + + if (script) + scriptfile_close(script); + scriptfile_clearsymbols(); + if (!script) return -1; + return 0; }