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
This commit is contained in:
Lucas GAUTHERON
2011-05-11 15:49:15 +00:00
parent 9c797155a9
commit 7782e8947d
+5 -1
View File
@@ -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();