1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-07-08 01:47:11 +02:00

Make the function environment optional in global callbacks.

This commit is contained in:
Sandu Liviu Catalin
2016-05-24 07:29:35 +03:00
parent 3ed0b22426
commit f8e845ebd2
2 changed files with 22 additions and 17 deletions

View File

@ -860,23 +860,6 @@ bool Core::DelVehicle(Int32 id, Int32 header, Object & payload)
return true;
}
// ------------------------------------------------------------------------------------------------
void Core::BindEvent(Int32 id, Object & env, Function & func)
{
// Obtain the function instance called for this event
Function & event = GetEvent(id);
// Is the specified callback function null?
if (func.IsNull())
{
event.Release(); // Then release the current callback
}
// Assign the specified environment and function
else
{
event = Function(env.GetVM(), env, func.GetFunc());
}
}
// --------------------------------------------------------------------------------------------
void Core::ConnectPlayer(Int32 id, Int32 header, Object & payload)
{