Added save/restore to client-side VScript

This commit is contained in:
Blixibon
2021-01-27 11:01:38 -06:00
parent 2ee7845e8d
commit fa45fffa39
14 changed files with 386 additions and 207 deletions

View File

@@ -161,6 +161,32 @@ public:
BaseClass::ClientThink();
}
void OnSave()
{
// HACKHACK: Save the next think in the VM since the VM is saved
if (m_bClientThink)
{
g_pScriptVM->SetValue( m_ScriptScope, "__c_think", GetNextThink() );
}
BaseClass::OnSave();
}
void OnRestore()
{
// HACKHACK: See OnSave()
if (m_bClientThink)
{
ScriptVariant_t flNextThink;
if (g_pScriptVM->GetValue( m_ScriptScope, "__c_think", &flNextThink ))
{
SetNextClientThink( flNextThink );
}
}
BaseClass::OnRestore();
}
#else
void InputCallScriptFunctionClient( inputdata_t &inputdata )
{