1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 00:37:15 +01:00

Added a helper function which can tell whether an event type can be inversed.

This commit is contained in:
Sandu Liviu Catalin 2015-10-11 21:06:28 +03:00
parent c7e776a1f7
commit 8e750efe85
2 changed files with 29 additions and 0 deletions

View File

@ -287,6 +287,30 @@ bool IsCustomEvent(SQInt32 type) noexcept
}
}
// ------------------------------------------------------------------------------------------------
bool CanBeInversed(SQInt32 type) noexcept
{
switch (type)
{
case EVT_KEYBINDKEYPRESS:
case EVT_KEYBINDKEYRELEASE:
case EVT_VEHICLEEMBARKING:
case EVT_VEHICLEEMBARKED:
case EVT_VEHICLEDISEMBARK:
case EVT_PICKUPCLAIMED:
case EVT_PICKUPCOLLECTED:
case EVT_OBJECTSHOT:
case EVT_OBJECTBUMP:
case EVT_CHECKPOINTENTERED:
case EVT_CHECKPOINTEXITED:
case EVT_SPHEREENTERED:
case EVT_SPHEREEXITED:
return true;
default:
return false;
}
}
// ================================================================================================
bool Register_Event(HSQUIRRELVM vm)
{

View File

@ -32,6 +32,11 @@ bool IsDestroyEvent(SQInt32 type) noexcept;
*/
bool IsCustomEvent(SQInt32 type) noexcept;
/* ------------------------------------------------------------------------------------------------
* ...
*/
bool CanBeInversed(SQInt32 type) noexcept;
} // Namespace:: SqMod
#endif // _SQMOD_EVENT_SHARED_HPP_