mirror of
https://github.com/celisej567/source-sdk-2013.git
synced 2026-09-23 20:09:45 +03:00
vscript additions and fixes:
vscript_client.cpp - Fixed local player script instance registration - Added CEntities::GetLocalPlayer - Added Con_IsVisible - Added IsWindowedMode - Added ScreenWidth - Added ScreenHeight - Added ScreenTransform - Added missing DoUniqueString gameinterface.cpp usercmd.h usercmd.cpp vscript_singletons.cpp - CNetMsgScriptHelper vscript_singletons.cpp - Added hash map for CScriptSaveRestoreUtil - Added hash map for CScriptGameEventListener::s_GameEvents - Changed CScriptGameEventListener string contexts to hashes - Added invalid input condition on CScriptGameEventListener::ListenToGameEvent - Moved CDebugOverlayScriptHelper to shared code ivscript.h vscript_squirrel.cpp - Added IScriptVM::Get/Set/ClearValue (ScriptVariant_t key) baseentity.h baseentity.cpp - Added CBaseEntity::SetContextThink (ScriptSetContextThink) vscript_server.cpp vscript_client.cpp vscript_funcs_shared.cpp - Changed the order user vscript_*.nut files are executed - after internal scripts, before mapspawn vscript_squirrel.cpp vscript_squirrel.nut vscript_server.nut vscript_shared.cpp - Localised all documentation under __Documentation hl2_usermessages.cpp - Added usermessage ScriptMsg c_baseplayer.cpp - Removed redundant check in ~C_BasePlayer
This commit is contained in:
@@ -10,12 +10,20 @@
|
||||
#include "bitbuf.h"
|
||||
#include "checksum_md5.h"
|
||||
|
||||
#ifdef MAPBASE_VSCRIPT
|
||||
#include "mapbase/vscript_singletons.h"
|
||||
#endif
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
|
||||
// TF2 specific, need enough space for OBJ_LAST items from tf_shareddefs.h
|
||||
#define WEAPON_SUBTYPE_BITS 6
|
||||
|
||||
#ifdef MAPBASE_VSCRIPT
|
||||
extern CNetMsgScriptHelper *g_ScriptNetMsg;
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Write a delta compressed user command.
|
||||
// Input : *buf -
|
||||
@@ -187,6 +195,22 @@ void WriteUsercmd( bf_write *buf, const CUserCmd *to, const CUserCmd *from )
|
||||
buf->WriteOneBit( 0 );
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined( MAPBASE_VSCRIPT ) && defined( CLIENT_DLL )
|
||||
Assert( g_ScriptNetMsg );
|
||||
|
||||
if ( g_ScriptNetMsg->m_bWriteReady )
|
||||
{
|
||||
buf->WriteOneBit( 1 );
|
||||
g_ScriptNetMsg->WriteToBuffer( buf );
|
||||
g_ScriptNetMsg->m_bWriteReady = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
buf->WriteOneBit( 0 );
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -196,7 +220,11 @@ void WriteUsercmd( bf_write *buf, const CUserCmd *to, const CUserCmd *from )
|
||||
// *from -
|
||||
// Output : static void ReadUsercmd
|
||||
//-----------------------------------------------------------------------------
|
||||
#if defined( MAPBASE_VSCRIPT ) && defined( GAME_DLL )
|
||||
void ReadUsercmd( bf_read *buf, CUserCmd *move, CUserCmd *from, CBaseEntity *pPlayer )
|
||||
#else
|
||||
void ReadUsercmd( bf_read *buf, CUserCmd *move, CUserCmd *from )
|
||||
#endif
|
||||
{
|
||||
// Assume no change
|
||||
*move = *from;
|
||||
@@ -303,4 +331,12 @@ void ReadUsercmd( bf_read *buf, CUserCmd *move, CUserCmd *from )
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined( MAPBASE_VSCRIPT ) && defined( GAME_DLL )
|
||||
if ( buf->ReadOneBit() )
|
||||
{
|
||||
g_ScriptNetMsg->RecieveMessage( buf, pPlayer );
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user