MCPcopy Index your code
hub / github.com/assaultcube/AC / execfile

Function execfile

source/src/command.cpp:953–971  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

951}
952
953bool execfile(const char *cfgfile)
954{
955 string s;
956 copystring(s, cfgfile);
957 setcontext("file", cfgfile);
958 bool oldpersist = persistidents;
959 char *buf = loadfile(path(s), NULL);
960 if(!buf)
961 {
962 resetcontext();
963 return false;
964 }
965 if(!currentcontextisolated && !strstr(s, "docs.cfg")) cleancubescript(buf);
966 execute(buf);
967 delete[] buf;
968 resetcontext();
969 persistidents = oldpersist;
970 return true;
971}
972
973void exec(const char *cfgfile)
974{

Callers 10

empty_worldFunction · 0.85
loadMethod · 0.85
execFunction · 0.85
load_worldFunction · 0.85
restoreMethod · 0.85
loadxmapFunction · 0.85
loadMethod · 0.85
mainFunction · 0.85
autostartscriptsFunction · 0.85
main.cppFile · 0.85

Calls 7

copystringFunction · 0.85
setcontextFunction · 0.85
loadfileFunction · 0.85
pathFunction · 0.85
resetcontextFunction · 0.85
cleancubescriptFunction · 0.85
executeFunction · 0.85

Tested by

no test coverage detected