Refactored the way certain classes and structs are exposed to VScript to make the code less reliant on metamethods and reduce awkward code placement

This commit is contained in:
Blixibon
2021-09-24 13:10:37 -05:00
parent f1bd6fcf81
commit 256cdfb7af
9 changed files with 205 additions and 121 deletions

View File

@@ -32,6 +32,9 @@
#include "gib.h"
#include "CRagdollMagnet.h"
#endif
#ifdef MAPBASE_VSCRIPT
#include "mapbase/vscript_funcs_shared.h"
#endif
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
@@ -1296,7 +1299,7 @@ bool CBaseAnimating::ScriptHookHandleAnimEvent( animevent_t *pEvent )
{
if (m_ScriptScope.IsInitialized() && g_Hook_HandleAnimEvent.CanRunInScope(m_ScriptScope))
{
HSCRIPT hEvent = g_pScriptVM->RegisterInstance( pEvent );
HSCRIPT hEvent = g_pScriptVM->RegisterInstance( reinterpret_cast<scriptanimevent_t*>(pEvent) );
// event
ScriptVariant_t args[] = { hEvent };