diff --git a/src/engine/console.h b/src/engine/console.h index 24322c365..8aaeba8f3 100644 --- a/src/engine/console.h +++ b/src/engine/console.h @@ -64,7 +64,7 @@ public: virtual bool LineIsValid(const char *pStr) = 0; virtual void ExecuteLine(const char *Sptr, const int ClientLevel, const int ClientId, FPrintCallback pfnAlternativePrintCallback = 0, void *pUserData = 0, FPrintCallback pfnAlternativePrintResponseCallback = 0, void *pResponseUserData = 0) = 0; virtual void ExecuteLineStroked(int Stroke, const char *pStr, const int ClientLevel, const int ClientId, FPrintCallback pfnAlternativePrintCallback = 0, void *pUserData = 0, FPrintCallback pfnAlternativePrintResponseCallback = 0, void *pResponseUserData = 0) = 0; - virtual void ExecuteFile(const char *pFilename, FPrintCallback pfnAlternativePrintCallback = 0, void *pUserData = 0, FPrintCallback pfnAlternativePrintResponseCallback = 0, void *pResponseUserData = 0) = 0; + virtual void ExecuteFile(const char *pFilename, FPrintCallback pfnAlternativePrintCallback = 0, void *pUserData = 0, FPrintCallback pfnAlternativePrintResponseCallback = 0, void *pResponseUserData = 0, int Level = 3) = 0; virtual void RegisterPrintCallback(FPrintCallback pfnPrintCallback, void *pUserData) = 0; virtual void RegisterAlternativePrintCallback(FPrintCallback pfnAlternativePrintCallback, void *pAlternativeUserData) = 0; diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp index 0103675d6..b72ce14ce 100644 --- a/src/engine/server/server.cpp +++ b/src/engine/server/server.cpp @@ -1211,7 +1211,7 @@ int CServer::Run() Console()->ExecuteLine("sv_hit 1",4,-1); Console()->ExecuteLine("sv_npc 0",4,-1); Console()->ExecuteLine("sv_phook 1",4,-1); - Console()->ExecuteLine("sv_endless_drag 0",4,-1); //TODO: Such string executed where autoexec executed. No need?? + Console()->ExecuteLine("sv_endless_drag 0",4,-1); // new map loaded GameServer()->OnShutdown(); @@ -1678,7 +1678,7 @@ int main(int argc, const char **argv) // ignore_convention pConsole->ExecuteLine("sv_phook 1",4,-1); pConsole->ExecuteLine("sv_endless_drag 0",4,-1); // execute autoexec file - pConsole->ExecuteFile("autoexec.cfg"); + pConsole->ExecuteFile("autoexec.cfg", 0, 0, 0, 0, 4); // parse the command line arguments if(argc > 1) // ignore_convention diff --git a/src/engine/shared/console.cpp b/src/engine/shared/console.cpp index fbb319d45..112bbbbe5 100644 --- a/src/engine/shared/console.cpp +++ b/src/engine/shared/console.cpp @@ -563,7 +563,7 @@ void CConsole::ExecuteLine(const char *pStr, const int ClientLevel, const int Cl } -void CConsole::ExecuteFile(const char *pFilename, FPrintCallback pfnAlternativePrintCallback, void *pUserData, FPrintCallback pfnAlternativePrintResponseCallback, void *pResponseUserData) +void CConsole::ExecuteFile(const char *pFilename, FPrintCallback pfnAlternativePrintCallback, void *pUserData, FPrintCallback pfnAlternativePrintResponseCallback, void *pResponseUserData, int Level) { // make sure that this isn't being executed already for(CExecFile *pCur = m_pFirstExec; pCur; pCur = pCur->m_pPrev) @@ -599,7 +599,7 @@ void CConsole::ExecuteFile(const char *pFilename, FPrintCallback pfnAlternativeP ReleaseAlternativePrintCallback(); while((pLine = lr.Get())) - ExecuteLine(pLine, 4, -1, pfnAlternativePrintCallback, pUserData, pfnAlternativePrintResponseCallback, pResponseUserData); + ExecuteLine(pLine, Level, -1, pfnAlternativePrintCallback, pUserData, pfnAlternativePrintResponseCallback, pResponseUserData); io_close(File); } diff --git a/src/engine/shared/console.h b/src/engine/shared/console.h index 9c4b646dc..4a4ac5788 100644 --- a/src/engine/shared/console.h +++ b/src/engine/shared/console.h @@ -46,7 +46,7 @@ class CConsole : public IConsole static void Con_Echo(IResult *pResult, void *pUserData, int ClientId); static void Con_Exec(IResult *pResult, void *pUserData, int ClientId); - void ExecuteFileRecurse(const char *pFilename, FPrintCallback pfnAlternativePrintCallback = 0, void *pUserData = 0, FPrintCallback pfnAlternativePrintResponseCallback = 0, void *pResponseUserData = 0); + void ExecuteFileRecurse(const char *pFilename, FPrintCallback pfnAlternativePrintCallback = 0, void *pUserData = 0, FPrintCallback pfnAlternativePrintResponseCallback = 0, void *pResponseUserData = 0, int Level = 3); virtual void ExecuteLineStroked(int Stroke, const char *pStr, const int ClientLevel, const int ClientId, FPrintCallback pfnAlternativePrintCallback = 0, void *pUserData = 0, FPrintCallback pfnAlternativePrintResponseCallback = 0, void *pResponseUserData = 0); FPrintCallback m_pfnPrintCallback; @@ -154,7 +154,7 @@ public: virtual bool LineIsValid(const char *pStr); virtual void ExecuteLine(const char *pStr, const int ClientLevel, const int ClientId, FPrintCallback pfnAlternativePrintCallback = 0, void *pUserData = 0, FPrintCallback pfnAlternativePrintResponseCallback = 0, void *pResponseUserData = 0); - virtual void ExecuteFile(const char *pFilename, FPrintCallback pfnAlternativePrintCallback = 0, void *pUserData = 0, FPrintCallback pfnAlternativePrintResponseCallback = 0, void *pResponseUserData = 0); + virtual void ExecuteFile(const char *pFilename, FPrintCallback pfnAlternativePrintCallback = 0, void *pUserData = 0, FPrintCallback pfnAlternativePrintResponseCallback = 0, void *pResponseUserData = 0, int Level = 3); virtual void RegisterPrintCallback(FPrintCallback pfnPrintCallback, void *pUserData); virtual void RegisterAlternativePrintCallback(FPrintCallback pfnAlternativePrintCallback, void *pAlternativeUserData);