mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-01-14 15:57:59 +03:00
Fixed the client-side VScript "player" instance not being set once more after having moved around the VM init code again
This commit is contained in:
parent
fa45fffa39
commit
14d3ee19d0
@ -855,6 +855,14 @@ void C_BasePlayer::PostDataUpdate( DataUpdateType_t updateType )
|
|||||||
// changed level, which would cause the snd_soundmixer to be left modified.
|
// changed level, which would cause the snd_soundmixer to be left modified.
|
||||||
ConVar *pVar = (ConVar *)cvar->FindVar( "snd_soundmixer" );
|
ConVar *pVar = (ConVar *)cvar->FindVar( "snd_soundmixer" );
|
||||||
pVar->Revert();
|
pVar->Revert();
|
||||||
|
|
||||||
|
#ifdef MAPBASE_VSCRIPT
|
||||||
|
// Moved here from LevelInitPostEntity, which is executed before local player is spawned.
|
||||||
|
if ( g_pScriptVM )
|
||||||
|
{
|
||||||
|
g_pScriptVM->SetValue( "player", GetScriptInstance() );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -576,13 +576,6 @@ bool VScriptClientInit()
|
|||||||
if( g_pScriptVM )
|
if( g_pScriptVM )
|
||||||
{
|
{
|
||||||
#ifdef MAPBASE_VSCRIPT
|
#ifdef MAPBASE_VSCRIPT
|
||||||
// Moved here from LevelInitPostEntity, which is executed before local player is spawned.
|
|
||||||
// This is executed after C_World::OnDataChanged, which is after C_BasePlayer::Spawn
|
|
||||||
if ( C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer() )
|
|
||||||
{
|
|
||||||
g_pScriptVM->SetValue( "player", pPlayer->GetScriptInstance() );
|
|
||||||
}
|
|
||||||
|
|
||||||
CGMsg( 0, CON_GROUP_VSCRIPT, "VSCRIPT CLIENT: Started VScript virtual machine using script language '%s'\n", g_pScriptVM->GetLanguageName() );
|
CGMsg( 0, CON_GROUP_VSCRIPT, "VSCRIPT CLIENT: Started VScript virtual machine using script language '%s'\n", g_pScriptVM->GetLanguageName() );
|
||||||
#else
|
#else
|
||||||
Log( "VSCRIPT: Started VScript virtual machine using script language '%s'\n", g_pScriptVM->GetLanguageName() );
|
Log( "VSCRIPT: Started VScript virtual machine using script language '%s'\n", g_pScriptVM->GetLanguageName() );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user