From 7782e8947da81b09be8a91fa9cf2962913ba9716 Mon Sep 17 00:00:00 2001 From: Lucas GAUTHERON Date: Wed, 11 May 2011 15:49:15 +0000 Subject: [PATCH] reset current context when a script file can't be executed git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6420 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/command.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/src/command.cpp b/source/src/command.cpp index 6c386d9d..6a4c1516 100644 --- a/source/src/command.cpp +++ b/source/src/command.cpp @@ -914,7 +914,11 @@ bool execfile(const char *cfgfile) copystring(s, cfgfile); setcontext("file", cfgfile); char *buf = loadfile(path(s), NULL); - if(!buf) return false; + if(!buf) + { + resetcontext(); + return false; + } execute(buf); delete[] buf; resetcontext();