1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-06-16 07:07:13 +02:00

Prevent silent failure uppon loading scripts that don't exist.

This commit is contained in:
Sandu Liviu Catalin
2020-04-30 22:28:01 +03:00
parent 88ef01e5e8
commit 1edc1930a3
3 changed files with 22 additions and 22 deletions

View File

@ -27,7 +27,7 @@ public:
{
if (!mFile)
{
throw std::runtime_error(ToStrF("Unable to open script source (%s)", path));
STHROWF("Unable to open script source (%s)", path);
}
}
@ -151,9 +151,9 @@ void ScriptSrc::Process()
}
// ------------------------------------------------------------------------------------------------
ScriptSrc::ScriptSrc(HSQUIRRELVM vm, String && path, bool delay, bool info)
ScriptSrc::ScriptSrc(HSQUIRRELVM vm, const String & path, bool delay, bool info)
: mExec(vm)
, mPath(std::move(path))
, mPath(path)
, mData()
, mLine()
, mInfo(info)

View File

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