mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 00:37:15 +01:00
Make the function environment optional in entity callbacks.
This commit is contained in:
parent
33790805eb
commit
3ed0b22426
@ -105,6 +105,11 @@ void CBlip::BindEvent(Int32 evid, Object & env, Function & func) const
|
||||
{
|
||||
event.Release(); // Then release the current callback
|
||||
}
|
||||
// Does this function need a custom environment?
|
||||
else if (env.IsNull())
|
||||
{
|
||||
event = func;
|
||||
}
|
||||
// Assign the specified environment and function
|
||||
else
|
||||
{
|
||||
|
@ -118,6 +118,11 @@ void CCheckpoint::BindEvent(Int32 evid, Object & env, Function & func) const
|
||||
{
|
||||
event.Release(); // Then release the current callback
|
||||
}
|
||||
// Does this function need a custom environment?
|
||||
else if (env.IsNull())
|
||||
{
|
||||
event = func;
|
||||
}
|
||||
// Assign the specified environment and function
|
||||
else
|
||||
{
|
||||
|
@ -105,6 +105,11 @@ void CKeybind::BindEvent(Int32 evid, Object & env, Function & func) const
|
||||
{
|
||||
event.Release(); // Then release the current callback
|
||||
}
|
||||
// Does this function need a custom environment?
|
||||
else if (env.IsNull())
|
||||
{
|
||||
event = func;
|
||||
}
|
||||
// Assign the specified environment and function
|
||||
else
|
||||
{
|
||||
|
@ -118,6 +118,11 @@ void CObject::BindEvent(Int32 evid, Object & env, Function & func) const
|
||||
{
|
||||
event.Release(); // Then release the current callback
|
||||
}
|
||||
// Does this function need a custom environment?
|
||||
else if (env.IsNull())
|
||||
{
|
||||
event = func;
|
||||
}
|
||||
// Assign the specified environment and function
|
||||
else
|
||||
{
|
||||
|
@ -110,6 +110,11 @@ void CPickup::BindEvent(Int32 evid, Object & env, Function & func) const
|
||||
{
|
||||
event.Release(); // Then release the current callback
|
||||
}
|
||||
// Does this function need a custom environment?
|
||||
else if (env.IsNull())
|
||||
{
|
||||
event = func;
|
||||
}
|
||||
// Assign the specified environment and function
|
||||
else
|
||||
{
|
||||
|
@ -127,6 +127,11 @@ void CPlayer::BindEvent(Int32 evid, Object & env, Function & func) const
|
||||
{
|
||||
event.Release(); // Then release the current callback
|
||||
}
|
||||
// Does this function need a custom environment?
|
||||
else if (env.IsNull())
|
||||
{
|
||||
event = func;
|
||||
}
|
||||
// Assign the specified environment and function
|
||||
else
|
||||
{
|
||||
|
@ -114,6 +114,11 @@ void CVehicle::BindEvent(Int32 evid, Object & env, Function & func) const
|
||||
{
|
||||
event.Release(); // Then release the current callback
|
||||
}
|
||||
// Does this function need a custom environment?
|
||||
else if (env.IsNull())
|
||||
{
|
||||
event = func;
|
||||
}
|
||||
// Assign the specified environment and function
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user