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:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user