mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-04-16 22:42:31 +03:00
Merge pull request #221 from samisalreadytaken/vscript-saverestore
VScript serialisation rewrite
This commit is contained in:
commit
e68b298a4d
@ -72,16 +72,16 @@ function ImpulseScale( flTargetMass, flDesiredSpeed )
|
|||||||
}
|
}
|
||||||
__Documentation.RegisterHelp( "ImpulseScale", "float ImpulseScale(float, float)", "Returns an impulse scale required to push an object." );
|
__Documentation.RegisterHelp( "ImpulseScale", "float ImpulseScale(float, float)", "Returns an impulse scale required to push an object." );
|
||||||
|
|
||||||
local PrecacheModel = PrecacheModel
|
local PrecacheModel = DoPrecacheModel
|
||||||
function PrecacheModel( a, b = true )
|
function PrecacheModel( a, b = true )
|
||||||
{
|
{
|
||||||
return PrecacheModel( a, b )
|
return PrecacheModel( a, b )
|
||||||
}
|
}
|
||||||
|
|
||||||
local PrecacheOther = PrecacheOther
|
local PrecacheOther = DoPrecacheOther
|
||||||
function PrecacheOther( a, b = "" )
|
function PrecacheOther( a, b = "" )
|
||||||
{
|
{
|
||||||
PrecacheOther( a, b )
|
return PrecacheOther( a, b )
|
||||||
}
|
}
|
||||||
|
|
||||||
function __ReplaceClosures( script, scope )
|
function __ReplaceClosures( script, scope )
|
||||||
@ -106,10 +106,9 @@ function __ReplaceClosures( script, scope )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local __OutputsPattern = regexp("^On.*Output$");
|
|
||||||
|
|
||||||
function ConnectOutputs( table )
|
function ConnectOutputs( table )
|
||||||
{
|
{
|
||||||
|
local __OutputsPattern = regexp("^On.*Output$");
|
||||||
local nCharsToStrip = 6;
|
local nCharsToStrip = 6;
|
||||||
foreach( key, val in table )
|
foreach( key, val in table )
|
||||||
{
|
{
|
||||||
|
@ -1071,10 +1071,10 @@ void RegisterSharedScriptFunctions()
|
|||||||
//
|
//
|
||||||
// Precaching
|
// Precaching
|
||||||
//
|
//
|
||||||
ScriptRegisterFunctionNamed( g_pScriptVM, ScriptPrecacheModel, "PrecacheModel", "Precaches a model for later usage." );
|
ScriptRegisterFunctionNamed( g_pScriptVM, ScriptPrecacheModel, "DoPrecacheModel", SCRIPT_ALIAS( "PrecacheModel", "Precaches a model for later usage." ) );
|
||||||
ScriptRegisterFunction( g_pScriptVM, PrecacheMaterial, "Precaches a material for later usage." );
|
ScriptRegisterFunction( g_pScriptVM, PrecacheMaterial, "Precaches a material for later usage." );
|
||||||
ScriptRegisterFunction( g_pScriptVM, PrecacheParticleSystem, "Precaches a particle system for later usage." );
|
ScriptRegisterFunction( g_pScriptVM, PrecacheParticleSystem, "Precaches a particle system for later usage." );
|
||||||
ScriptRegisterFunctionNamed( g_pScriptVM, ScriptPrecacheOther, "PrecacheOther", "Precaches an entity class for later usage." );
|
ScriptRegisterFunctionNamed( g_pScriptVM, ScriptPrecacheOther, "DoPrecacheOther", SCRIPT_ALIAS( "PrecacheOther", "Precaches an entity class for later usage." ) );
|
||||||
|
|
||||||
//
|
//
|
||||||
// NPCs
|
// NPCs
|
||||||
|
@ -507,7 +507,7 @@ void RunAutorunScripts()
|
|||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
static short VSCRIPT_SERVER_SAVE_RESTORE_VERSION = 2;
|
static short VSCRIPT_SERVER_SAVE_RESTORE_VERSION = 3;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -360,6 +360,7 @@ struct ScriptClassDesc_t
|
|||||||
IScriptInstanceHelper * pHelper; // optional helper
|
IScriptInstanceHelper * pHelper; // optional helper
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
#ifdef MAPBASE_VSCRIPT
|
||||||
|
public:
|
||||||
static CUtlVector<ScriptClassDesc_t*>& AllClassesDesc()
|
static CUtlVector<ScriptClassDesc_t*>& AllClassesDesc()
|
||||||
{
|
{
|
||||||
static CUtlVector<ScriptClassDesc_t*> classes;
|
static CUtlVector<ScriptClassDesc_t*> classes;
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user