1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-02-21 20:27:13 +01:00

Make constructor public in script container.

Throw exception if trying to create script container with invalid VM.
This commit is contained in:
Sandu Liviu Catalin 2016-06-17 03:26:29 +03:00
parent 2b6fdcd855
commit 2242ac9394
2 changed files with 6 additions and 8 deletions

View File

@ -150,8 +150,13 @@ ScriptSrc::ScriptSrc(HSQUIRRELVM vm, const String & path, bool info)
{ {
throw std::runtime_error("Invalid or empty script path"); throw std::runtime_error("Invalid or empty script path");
} }
// Is the specified virtual machine invalid?
else if (!vm)
{
throw std::runtime_error("Invalid virtual machine pointer");
}
// Should we load the file contents for debugging purposes? // Should we load the file contents for debugging purposes?
if (info) else if (info)
{ {
Process(); Process();
} }

View File

@ -19,9 +19,6 @@ class Core;
*/ */
class ScriptSrc class ScriptSrc
{ {
// --------------------------------------------------------------------------------------------
friend class Core;
public: public:
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
@ -33,8 +30,6 @@ public:
String mData; // The contents of the script file. String mData; // The contents of the script file.
Line mLine; // List of lines of code in the data. Line mLine; // List of lines of code in the data.
private:
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Read file contents and calculate information about the lines of code. * Read file contents and calculate information about the lines of code.
*/ */
@ -45,8 +40,6 @@ private:
*/ */
ScriptSrc(HSQUIRRELVM vm, const String & path, bool info = false); ScriptSrc(HSQUIRRELVM vm, const String & path, bool info = false);
public:
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Copy constructor. * Copy constructor.
*/ */