1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-08-05 07:31:48 +02:00

Update the module registration code to include the virtual machine as a function argument.

This commit is contained in:
Sandu Liviu Catalin
2016-07-19 21:13:56 +03:00
parent 5cc8cfffa9
commit cac237c3cb
8 changed files with 55 additions and 55 deletions

View File

@@ -11,10 +11,10 @@ namespace SqMod {
/* ------------------------------------------------------------------------------------------------
* Register the module API under the obtained virtual machine.
*/
static bool RegisterAPI()
static bool RegisterAPI(HSQUIRRELVM vm)
{
// Make sure there's a valid virtual machine before proceeding
if (!DefaultVM::Get())
if (!vm)
{
OutputError("%s: Cannot register API without a valid virtual machine", SQMMDB_NAME);
// Registration failed
@@ -52,7 +52,7 @@ static bool OnSquirrelLoad()
NullObject() = Object();
NullFunction() = Function();
// Register the module API
if (RegisterAPI())
if (RegisterAPI(DefaultVM::Get()))
{
OutputMessage("Registered: %s", SQMMDB_NAME);
}