Improvements based on experience from implementing Python runtime

This commit is contained in:
Lukas Aldershaab 2023-06-02 16:36:04 +02:00
parent e28e24a802
commit 83ea6cd0df
6 changed files with 67 additions and 188 deletions

View file

@ -95,16 +95,12 @@ namespace TorqueScript
//------------------------------------------------------------------------------
Con::EvalResult TorqueScriptRuntime::evaluatef(const char* string, ...)
{
ConsoleStackFrameSaver stackSaver;
stackSaver.save();
char buffer[4096];
va_list args;
va_start(args, string);
dVsprintf(buffer, sizeof(buffer), string, args);
va_end(args);
CodeBlock* newCodeBlock = new CodeBlock();
return newCodeBlock->compileExec(NULL, buffer, false, 0);
return evaluate(buffer);
}
bool TorqueScriptRuntime::executeFile(const char* fileName, bool noCalls, bool journalScript)