mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-04-16 22:42:31 +03:00
Prevent nesting in serialisation of Precache functions
On every save on a load, these functions would keep reference to their old versions from the previous save which kept stacking up on each load-save
This commit is contained in:
parent
af6c22e058
commit
7525068fc0
@ -72,16 +72,16 @@ function ImpulseScale( flTargetMass, flDesiredSpeed )
|
||||
}
|
||||
__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 )
|
||||
{
|
||||
return PrecacheModel( a, b )
|
||||
}
|
||||
|
||||
local PrecacheOther = PrecacheOther
|
||||
local PrecacheOther = DoPrecacheOther
|
||||
function PrecacheOther( a, b = "" )
|
||||
{
|
||||
PrecacheOther( a, b )
|
||||
return PrecacheOther( a, b )
|
||||
}
|
||||
|
||||
function __ReplaceClosures( script, scope )
|
||||
@ -106,10 +106,9 @@ function __ReplaceClosures( script, scope )
|
||||
}
|
||||
}
|
||||
|
||||
local __OutputsPattern = regexp("^On.*Output$");
|
||||
|
||||
function ConnectOutputs( table )
|
||||
{
|
||||
local __OutputsPattern = regexp("^On.*Output$");
|
||||
local nCharsToStrip = 6;
|
||||
foreach( key, val in table )
|
||||
{
|
||||
|
@ -1049,10 +1049,10 @@ void RegisterSharedScriptFunctions()
|
||||
//
|
||||
// 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, 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user