1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 00:37:15 +01:00

Remove the need to specify a VM after new changes.

This commit is contained in:
Sandu Liviu Catalin 2020-09-04 18:52:09 +03:00
parent 78fac29da0
commit 6fa8e85189
3 changed files with 6 additions and 11 deletions

View File

@ -151,21 +151,16 @@ void ScriptSrc::Process()
}
// ------------------------------------------------------------------------------------------------
ScriptSrc::ScriptSrc(HSQUIRRELVM vm, const String & path, bool delay, bool info)
: mExec(vm)
ScriptSrc::ScriptSrc(const String & path, bool delay, bool info)
: mExec()
, mPath(path)
, mData()
, mLine()
, mInfo(info)
, mDelay(delay)
{
// Is the specified virtual machine invalid?
if (!vm)
{
throw std::runtime_error("Invalid virtual machine pointer");
}
// Is the specified path empty?
else if (mPath.empty())
if (mPath.empty())
{
throw std::runtime_error("Invalid or empty script path");
}

View File

@ -39,7 +39,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Base constructor.
*/
ScriptSrc(HSQUIRRELVM vm, const String & path, bool delay = false, bool info = false);
ScriptSrc(const String & path, bool delay = false, bool info = false);
/* --------------------------------------------------------------------------------------------
* Copy constructor.

View File

@ -686,7 +686,7 @@ bool Core::LoadScript(CSStr filepath, bool delay)
else if (m_Executed)
{
// Create a new script container and insert it into the script pool
m_Scripts.emplace_back(m_VM, path, delay, m_Debugging);
m_Scripts.emplace_back(path, delay, m_Debugging);
// Attempt to load and compile the script file
try
@ -728,7 +728,7 @@ bool Core::LoadScript(CSStr filepath, bool delay)
try
{
// Create a new script container and insert it into the pending script pool
m_PendingScripts.emplace_back(m_VM, path, delay, m_Debugging);
m_PendingScripts.emplace_back(path, delay, m_Debugging);
}
catch (const Sqrat::Exception & e)
{