mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-04-16 22:42:31 +03:00
Mapbase TF2 compatibility
This commit is contained in:
parent
78971f6d56
commit
8fa677c27c
@ -99,7 +99,8 @@ public:
|
|||||||
|
|
||||||
#ifdef GLOWS_ENABLE
|
#ifdef GLOWS_ENABLE
|
||||||
CGlowObject *GetGlowObject( void ){ return m_pGlowEffect; }
|
CGlowObject *GetGlowObject( void ){ return m_pGlowEffect; }
|
||||||
virtual void GetGlowEffectColor( float *r, float *g, float *b, float *a = NULL );
|
virtual void GetGlowEffectColor( float *r, float *g, float *b, float *a );
|
||||||
|
virtual void GetGlowEffectColor( float *r, float *g, float *b ) { GetGlowEffectColor( r, g, b, NULL ); }
|
||||||
// void EnableGlowEffect( float r, float g, float b );
|
// void EnableGlowEffect( float r, float g, float b );
|
||||||
|
|
||||||
void SetClientSideGlowEnabled( bool bEnabled ){ m_bClientSideGlowEnabled = bEnabled; UpdateGlowEffect(); }
|
void SetClientSideGlowEnabled( bool bEnabled ){ m_bClientSideGlowEnabled = bEnabled; UpdateGlowEffect(); }
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
// memdbgon must be the last include file in a .cpp file!!!
|
// memdbgon must be the last include file in a .cpp file!!!
|
||||||
#include "tier0/memdbgon.h"
|
#include "tier0/memdbgon.h"
|
||||||
|
|
||||||
#if defined(CSTRIKE_DLL) || defined (MAPBASE)
|
#if defined(CSTRIKE_DLL) || (defined(MAPBASE) && !defined(TF_CLIENT_DLL))
|
||||||
ConVar cl_righthand( "cl_righthand", "1", FCVAR_ARCHIVE, "Use right-handed view models." );
|
ConVar cl_righthand( "cl_righthand", "1", FCVAR_ARCHIVE, "Use right-handed view models." );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -197,7 +197,7 @@ bool C_BaseViewModel::Interpolate( float currentTime )
|
|||||||
|
|
||||||
bool C_BaseViewModel::ShouldFlipViewModel()
|
bool C_BaseViewModel::ShouldFlipViewModel()
|
||||||
{
|
{
|
||||||
#if defined(CSTRIKE_DLL) || defined (MAPBASE)
|
#if defined(CSTRIKE_DLL) || (defined(MAPBASE) && !defined(TF_CLIENT_DLL))
|
||||||
// If cl_righthand is set, then we want them all right-handed.
|
// If cl_righthand is set, then we want them all right-handed.
|
||||||
CBaseCombatWeapon *pWeapon = m_hWeapon.Get();
|
CBaseCombatWeapon *pWeapon = m_hWeapon.Get();
|
||||||
if ( pWeapon )
|
if ( pWeapon )
|
||||||
|
@ -47,6 +47,9 @@ protected:
|
|||||||
unsigned char m_iControlPointParents[kMAXCONTROLPOINTS];
|
unsigned char m_iControlPointParents[kMAXCONTROLPOINTS];
|
||||||
|
|
||||||
bool m_bWeatherEffect;
|
bool m_bWeatherEffect;
|
||||||
|
#ifdef MAPBASE
|
||||||
|
bool m_bUsesCoordinates;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
IMPLEMENT_CLIENTCLASS(C_ParticleSystem, DT_ParticleSystem, CParticleSystem);
|
IMPLEMENT_CLIENTCLASS(C_ParticleSystem, DT_ParticleSystem, CParticleSystem);
|
||||||
@ -69,6 +72,9 @@ BEGIN_RECV_TABLE_NOBASE( C_ParticleSystem, DT_ParticleSystem )
|
|||||||
RecvPropArray3( RECVINFO_ARRAY(m_vControlPointVecs), RecvPropVector( RECVINFO( m_vControlPointVecs[0] ) ) ),
|
RecvPropArray3( RECVINFO_ARRAY(m_vControlPointVecs), RecvPropVector( RECVINFO( m_vControlPointVecs[0] ) ) ),
|
||||||
RecvPropArray3( RECVINFO_ARRAY(m_iControlPointParents), RecvPropInt( RECVINFO(m_iControlPointParents[0]))),
|
RecvPropArray3( RECVINFO_ARRAY(m_iControlPointParents), RecvPropInt( RECVINFO(m_iControlPointParents[0]))),
|
||||||
RecvPropBool( RECVINFO( m_bWeatherEffect ) ),
|
RecvPropBool( RECVINFO( m_bWeatherEffect ) ),
|
||||||
|
#ifdef MAPBASE
|
||||||
|
RecvPropBool( RECVINFO( m_bUsesCoordinates ) ),
|
||||||
|
#endif
|
||||||
END_RECV_TABLE();
|
END_RECV_TABLE();
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -77,6 +83,9 @@ END_RECV_TABLE();
|
|||||||
C_ParticleSystem::C_ParticleSystem()
|
C_ParticleSystem::C_ParticleSystem()
|
||||||
{
|
{
|
||||||
m_bWeatherEffect = false;
|
m_bWeatherEffect = false;
|
||||||
|
#ifdef MAPBASE
|
||||||
|
m_bDestroyImmediately = false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -152,7 +161,7 @@ void C_ParticleSystem::ClientThink( void )
|
|||||||
AssertMsg1( pEffect, "Particle system couldn't make %s", pszName );
|
AssertMsg1( pEffect, "Particle system couldn't make %s", pszName );
|
||||||
if (pEffect)
|
if (pEffect)
|
||||||
{
|
{
|
||||||
if (m_vControlPointVecs[0] != GetAbsOrigin() && m_hControlPointEnts[0] == NULL)
|
if ( m_bUsesCoordinates )
|
||||||
{
|
{
|
||||||
// we are using info_particle_system_coordinate
|
// we are using info_particle_system_coordinate
|
||||||
for (int i = 0; i < kMAXCONTROLPOINTS; ++i)
|
for (int i = 0; i < kMAXCONTROLPOINTS; ++i)
|
||||||
|
@ -53,7 +53,7 @@ $Project
|
|||||||
$File "$SRCDIR\game\shared\mapbase\vscript_funcs_shared.h" [$MAPBASE_VSCRIPT]
|
$File "$SRCDIR\game\shared\mapbase\vscript_funcs_shared.h" [$MAPBASE_VSCRIPT]
|
||||||
$File "$SRCDIR\game\shared\mapbase\vscript_singletons.cpp" [$MAPBASE_VSCRIPT]
|
$File "$SRCDIR\game\shared\mapbase\vscript_singletons.cpp" [$MAPBASE_VSCRIPT]
|
||||||
$File "$SRCDIR\game\shared\mapbase\vscript_singletons.h" [$MAPBASE_VSCRIPT]
|
$File "$SRCDIR\game\shared\mapbase\vscript_singletons.h" [$MAPBASE_VSCRIPT]
|
||||||
$File "$SRCDIR\game\shared\mapbase\vscript_funcs_hl2.cpp" [$MAPBASE_VSCRIPT]
|
$File "$SRCDIR\game\shared\mapbase\vscript_funcs_hl2.cpp" [$MAPBASE_VSCRIPT&&($HL2||$EPISODIC)]
|
||||||
$File "$SRCDIR\game\shared\mapbase\vscript_consts_shared.cpp" [$MAPBASE_VSCRIPT]
|
$File "$SRCDIR\game\shared\mapbase\vscript_consts_shared.cpp" [$MAPBASE_VSCRIPT]
|
||||||
$File "$SRCDIR\game\shared\mapbase\vscript_consts_weapons.cpp" [$MAPBASE_VSCRIPT]
|
$File "$SRCDIR\game\shared\mapbase\vscript_consts_weapons.cpp" [$MAPBASE_VSCRIPT]
|
||||||
$File "$SRCDIR\game\shared\mapbase\weapon_custom_scripted.cpp" [$MAPBASE_VSCRIPT]
|
$File "$SRCDIR\game\shared\mapbase\weapon_custom_scripted.cpp" [$MAPBASE_VSCRIPT]
|
||||||
@ -69,18 +69,18 @@ $Project
|
|||||||
$File "mapbase\c_func_fake_worldportal.h"
|
$File "mapbase\c_func_fake_worldportal.h"
|
||||||
$File "mapbase\c_point_glow.cpp"
|
$File "mapbase\c_point_glow.cpp"
|
||||||
$File "mapbase\c_vgui_text_display.cpp"
|
$File "mapbase\c_vgui_text_display.cpp"
|
||||||
$File "mapbase\c_weapon_custom_hl2.cpp"
|
$File "mapbase\c_weapon_custom_hl2.cpp" [$HL2||$EPISODIC]
|
||||||
$File "mapbase\mapbase_autocubemap.cpp"
|
$File "mapbase\mapbase_autocubemap.cpp"
|
||||||
}
|
}
|
||||||
|
|
||||||
$Folder "HL2 DLL"
|
$Folder "HL2 DLL" [$HL2||$EPISODIC]
|
||||||
{
|
{
|
||||||
// Original stunstick files are conditional'd out in the HL2 VPCs
|
// Original stunstick files are conditional'd out in the HL2 VPCs
|
||||||
$File "$SRCDIR\game\shared\hl2mp\weapon_stunstick.cpp"
|
$File "$SRCDIR\game\shared\hl2mp\weapon_stunstick.cpp"
|
||||||
$File "$SRCDIR\game\shared\hl2mp\weapon_stunstick.h"
|
$File "$SRCDIR\game\shared\hl2mp\weapon_stunstick.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
$Folder "HL2MP"
|
$Folder "HL2MP" [$HL2||$EPISODIC]
|
||||||
{
|
{
|
||||||
$Folder "Weapons"
|
$Folder "Weapons"
|
||||||
{
|
{
|
||||||
|
@ -50,11 +50,12 @@ ConVar locator_icon_max_size_non_ss( "locator_icon_max_size_non_ss", "1.5", FCVA
|
|||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
DRAW_ARROW_NO = 0,
|
// "LOCATOR_" prefix added for TF2 compatibility (collision in tf_shareddefs.h)
|
||||||
DRAW_ARROW_UP,
|
LOCATOR_DRAW_ARROW_NO = 0,
|
||||||
DRAW_ARROW_DOWN,
|
LOCATOR_DRAW_ARROW_UP,
|
||||||
DRAW_ARROW_LEFT,
|
LOCATOR_DRAW_ARROW_DOWN,
|
||||||
DRAW_ARROW_RIGHT
|
LOCATOR_DRAW_ARROW_LEFT,
|
||||||
|
LOCATOR_DRAW_ARROW_RIGHT
|
||||||
};
|
};
|
||||||
|
|
||||||
ConVar locator_fade_time( "locator_fade_time", "0.3", FCVAR_NONE, "Number of seconds it takes for a lesson to fully fade in/out." );
|
ConVar locator_fade_time( "locator_fade_time", "0.3", FCVAR_NONE, "Number of seconds it takes for a lesson to fully fade in/out." );
|
||||||
@ -126,7 +127,7 @@ void CLocatorTarget::Activate( int serialNumber )
|
|||||||
m_lastXPos = iStartX;
|
m_lastXPos = iStartX;
|
||||||
m_lastYPos = iStartY;
|
m_lastYPos = iStartY;
|
||||||
|
|
||||||
m_drawArrowDirection = DRAW_ARROW_NO;
|
m_drawArrowDirection = LOCATOR_DRAW_ARROW_NO;
|
||||||
m_lerpStart = gpGlobals->curtime;
|
m_lerpStart = gpGlobals->curtime;
|
||||||
m_pulseStart = gpGlobals->curtime;
|
m_pulseStart = gpGlobals->curtime;
|
||||||
m_declutterIndex = 0;
|
m_declutterIndex = 0;
|
||||||
@ -1369,7 +1370,7 @@ void CLocatorPanel::ComputeTargetIconPosition( CLocatorTarget *pTarget, bool bSe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pTarget->m_drawArrowDirection = DRAW_ARROW_NO;
|
pTarget->m_drawArrowDirection = LOCATOR_DRAW_ARROW_NO;
|
||||||
|
|
||||||
float fTitleSafeInset = ScreenWidth() * 0.075f;
|
float fTitleSafeInset = ScreenWidth() * 0.075f;
|
||||||
|
|
||||||
@ -1392,9 +1393,9 @@ void CLocatorPanel::ComputeTargetIconPosition( CLocatorTarget *pTarget, bool bSe
|
|||||||
|
|
||||||
Vector vCenter = pTarget->m_vecOrigin;
|
Vector vCenter = pTarget->m_vecOrigin;
|
||||||
if( MainViewRight().Dot( vCenter - MainViewOrigin() ) > 0 )
|
if( MainViewRight().Dot( vCenter - MainViewOrigin() ) > 0 )
|
||||||
pTarget->m_drawArrowDirection = DRAW_ARROW_RIGHT;
|
pTarget->m_drawArrowDirection = LOCATOR_DRAW_ARROW_RIGHT;
|
||||||
else
|
else
|
||||||
pTarget->m_drawArrowDirection = DRAW_ARROW_LEFT;
|
pTarget->m_drawArrowDirection = LOCATOR_DRAW_ARROW_LEFT;
|
||||||
}
|
}
|
||||||
else if( iconY < fTitleSafeInset || iconY > ScreenHeight() - fTitleSafeInset )
|
else if( iconY < fTitleSafeInset || iconY > ScreenHeight() - fTitleSafeInset )
|
||||||
{
|
{
|
||||||
@ -1415,9 +1416,9 @@ void CLocatorPanel::ComputeTargetIconPosition( CLocatorTarget *pTarget, bool bSe
|
|||||||
|
|
||||||
Vector vCenter = pTarget->m_vecOrigin;
|
Vector vCenter = pTarget->m_vecOrigin;
|
||||||
if( MainViewUp().Dot( vCenter - MainViewOrigin() ) > 0 )
|
if( MainViewUp().Dot( vCenter - MainViewOrigin() ) > 0 )
|
||||||
pTarget->m_drawArrowDirection = DRAW_ARROW_UP;
|
pTarget->m_drawArrowDirection = LOCATOR_DRAW_ARROW_UP;
|
||||||
else
|
else
|
||||||
pTarget->m_drawArrowDirection = DRAW_ARROW_DOWN;
|
pTarget->m_drawArrowDirection = LOCATOR_DRAW_ARROW_DOWN;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2093,28 +2094,28 @@ void CLocatorPanel::DrawIndicatorArrow( int x, int y, int iconWide, int iconTall
|
|||||||
|
|
||||||
switch( direction )
|
switch( direction )
|
||||||
{
|
{
|
||||||
case DRAW_ARROW_LEFT:
|
case LOCATOR_DRAW_ARROW_LEFT:
|
||||||
vgui::surface()->DrawSetTexture( m_textureID_ArrowLeft );
|
vgui::surface()->DrawSetTexture( m_textureID_ArrowLeft );
|
||||||
x -= wide;
|
x -= wide;
|
||||||
y += iconTall / 2 - tall / 2;
|
y += iconTall / 2 - tall / 2;
|
||||||
vgui::surface()->DrawTexturedRect( x, y, x + wide, y + tall );
|
vgui::surface()->DrawTexturedRect( x, y, x + wide, y + tall );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DRAW_ARROW_RIGHT:
|
case LOCATOR_DRAW_ARROW_RIGHT:
|
||||||
vgui::surface()->DrawSetTexture( m_textureID_ArrowRight );
|
vgui::surface()->DrawSetTexture( m_textureID_ArrowRight );
|
||||||
x += iconWide + textWidth;
|
x += iconWide + textWidth;
|
||||||
y += iconTall / 2 - tall / 2;
|
y += iconTall / 2 - tall / 2;
|
||||||
vgui::surface()->DrawTexturedRect( x, y, x + wide, y + tall );
|
vgui::surface()->DrawTexturedRect( x, y, x + wide, y + tall );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DRAW_ARROW_UP:
|
case LOCATOR_DRAW_ARROW_UP:
|
||||||
vgui::surface()->DrawSetTexture( m_textureID_ArrowUp );
|
vgui::surface()->DrawSetTexture( m_textureID_ArrowUp );
|
||||||
x += iconWide / 2 - wide / 2;
|
x += iconWide / 2 - wide / 2;
|
||||||
y -= tall;
|
y -= tall;
|
||||||
vgui::surface()->DrawTexturedRect( x, y, x + wide, y + tall );
|
vgui::surface()->DrawTexturedRect( x, y, x + wide, y + tall );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DRAW_ARROW_DOWN:
|
case LOCATOR_DRAW_ARROW_DOWN:
|
||||||
vgui::surface()->DrawSetTexture( m_textureID_ArrowDown );
|
vgui::surface()->DrawSetTexture( m_textureID_ArrowDown );
|
||||||
x += iconWide / 2 - wide / 2;
|
x += iconWide / 2 - wide / 2;
|
||||||
y += iconTall;
|
y += iconTall;
|
||||||
|
@ -400,7 +400,7 @@ void VideoPanel::Paint( void )
|
|||||||
// Draw the polys to draw this out
|
// Draw the polys to draw this out
|
||||||
CMatRenderContextPtr pRenderContext( materials );
|
CMatRenderContextPtr pRenderContext( materials );
|
||||||
|
|
||||||
#ifdef MAPBASE
|
#if defined(MAPBASE) && !defined(TF_CLIENT_DLL) // TODO: Figure out actual purpose of this
|
||||||
pRenderContext->ClearColor4ub( 255, 255, 255, alpha * 255.0f );
|
pRenderContext->ClearColor4ub( 255, 255, 255, alpha * 255.0f );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -43,9 +43,14 @@ HSCRIPT INextBotComponent::GetScriptInstance()
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------
|
||||||
#ifdef TF_DLL
|
#ifdef TF_DLL
|
||||||
|
#ifndef MAPBASE_VSCRIPT // TODO: Need better way of supporting this
|
||||||
DEFINE_SCRIPT_INSTANCE_HELPER( INextBotComponent, &g_NextBotComponentScriptInstanceHelper )
|
DEFINE_SCRIPT_INSTANCE_HELPER( INextBotComponent, &g_NextBotComponentScriptInstanceHelper )
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
BEGIN_ENT_SCRIPTDESC_ROOT( INextBotComponent, "Next bot component" )
|
BEGIN_ENT_SCRIPTDESC_ROOT( INextBotComponent, "Next bot component" )
|
||||||
|
#ifdef MAPBASE_VSCRIPT
|
||||||
|
DEFINE_SCRIPT_INSTANCE_HELPER( &g_NextBotComponentScriptInstanceHelper )
|
||||||
|
#endif
|
||||||
DEFINE_SCRIPTFUNC( Reset, "Resets the internal update state" )
|
DEFINE_SCRIPTFUNC( Reset, "Resets the internal update state" )
|
||||||
DEFINE_SCRIPTFUNC( ComputeUpdateInterval, "Recomputes the component update interval" )
|
DEFINE_SCRIPTFUNC( ComputeUpdateInterval, "Recomputes the component update interval" )
|
||||||
DEFINE_SCRIPTFUNC( GetUpdateInterval, "Returns the component update interval" )
|
DEFINE_SCRIPTFUNC( GetUpdateInterval, "Returns the component update interval" )
|
||||||
|
@ -709,8 +709,10 @@ bool CAI_BaseNPC::FriendlyFireEnabled()
|
|||||||
if (m_FriendlyFireOverride != TRS_NONE)
|
if (m_FriendlyFireOverride != TRS_NONE)
|
||||||
return m_FriendlyFireOverride == TRS_TRUE;
|
return m_FriendlyFireOverride == TRS_TRUE;
|
||||||
|
|
||||||
|
#ifdef HL2_DLL
|
||||||
if (HL2GameRules()->GlobalFriendlyFire() != TRS_NONE)
|
if (HL2GameRules()->GlobalFriendlyFire() != TRS_NONE)
|
||||||
return HL2GameRules()->GlobalFriendlyFire() == TRS_TRUE;
|
return HL2GameRules()->GlobalFriendlyFire() == TRS_TRUE;
|
||||||
|
#endif
|
||||||
|
|
||||||
return !(CapabilitiesGet() & bits_CAP_FRIENDLY_DMG_IMMUNE);
|
return !(CapabilitiesGet() & bits_CAP_FRIENDLY_DMG_IMMUNE);
|
||||||
}
|
}
|
||||||
@ -15922,6 +15924,7 @@ bool CanNPCsTradePlaces( CAI_BaseNPC *pNPC1, CAI_BaseNPC *pNPC2, bool bDebug )
|
|||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
bool CAI_BaseNPC::InteractionIsAllowed( CAI_BaseNPC *pOtherNPC, ScriptedNPCInteraction_t *pInteraction )
|
bool CAI_BaseNPC::InteractionIsAllowed( CAI_BaseNPC *pOtherNPC, ScriptedNPCInteraction_t *pInteraction )
|
||||||
{
|
{
|
||||||
|
#ifdef HL2_DLL
|
||||||
// Now that female citizens have hunter interactions, Alyx is vulnerable to being murdered by hunters *dynamically*!
|
// Now that female citizens have hunter interactions, Alyx is vulnerable to being murdered by hunters *dynamically*!
|
||||||
// Citizens also have antlion interaction kill animations, so antlions could potentially murder her as well.
|
// Citizens also have antlion interaction kill animations, so antlions could potentially murder her as well.
|
||||||
//
|
//
|
||||||
@ -15929,6 +15932,7 @@ bool CAI_BaseNPC::InteractionIsAllowed( CAI_BaseNPC *pOtherNPC, ScriptedNPCInter
|
|||||||
// Hopefully there aren't any maps that already have hunters murder Barneys.
|
// Hopefully there aren't any maps that already have hunters murder Barneys.
|
||||||
if (pOtherNPC->Classify() == CLASS_PLAYER_ALLY_VITAL)
|
if (pOtherNPC->Classify() == CLASS_PLAYER_ALLY_VITAL)
|
||||||
return false;
|
return false;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (m_iDynamicInteractionsAllowed == TRS_FALSE)
|
if (m_iDynamicInteractionsAllowed == TRS_FALSE)
|
||||||
return false;
|
return false;
|
||||||
|
@ -4239,11 +4239,13 @@ void CBaseCombatCharacter::InputGiveWeapon( inputdata_t &inputdata )
|
|||||||
{
|
{
|
||||||
if (IsNPC())
|
if (IsNPC())
|
||||||
{
|
{
|
||||||
|
#ifdef HL2_DLL
|
||||||
if( Classify() == CLASS_PLAYER_ALLY_VITAL )
|
if( Classify() == CLASS_PLAYER_ALLY_VITAL )
|
||||||
{
|
{
|
||||||
MyNPCPointer()->m_iszPendingWeapon = iszWeaponName;
|
MyNPCPointer()->m_iszPendingWeapon = iszWeaponName;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
MyNPCPointer()->GiveWeapon( iszWeaponName );
|
MyNPCPointer()->GiveWeapon( iszWeaponName );
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,8 @@ public:
|
|||||||
|
|
||||||
// Start the specifics of an scene event
|
// Start the specifics of an scene event
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
virtual bool StartSceneEvent( CSceneEventInfo *info, CChoreoScene *scene, CChoreoEvent *event, CChoreoActor *actor, CBaseEntity *pTarget, CSceneEntity *pSceneEnt = NULL );
|
virtual bool StartSceneEvent( CSceneEventInfo *info, CChoreoScene *scene, CChoreoEvent *event, CChoreoActor *actor, CBaseEntity *pTarget, CSceneEntity *pSceneEnt );
|
||||||
|
virtual bool StartSceneEvent( CSceneEventInfo *info, CChoreoScene *scene, CChoreoEvent *event, CChoreoActor *actor, CBaseEntity *pTarget ) { return StartSceneEvent( info, scene, event, actor, pTarget, NULL ); }
|
||||||
#else
|
#else
|
||||||
virtual bool StartSceneEvent( CSceneEventInfo *info, CChoreoScene *scene, CChoreoEvent *event, CChoreoActor *actor, CBaseEntity *pTarget );
|
virtual bool StartSceneEvent( CSceneEventInfo *info, CChoreoScene *scene, CChoreoEvent *event, CChoreoActor *actor, CBaseEntity *pTarget );
|
||||||
#endif
|
#endif
|
||||||
|
@ -22,10 +22,13 @@
|
|||||||
#include "npc_playercompanion.h"
|
#include "npc_playercompanion.h"
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
#include "hl2_player.h"
|
#include "hl2_player.h"
|
||||||
#include "mapbase_matchers_base.h"
|
|
||||||
#endif
|
#endif
|
||||||
#endif // HL2_DLL
|
#endif // HL2_DLL
|
||||||
|
|
||||||
|
#ifdef MAPBASE
|
||||||
|
#include "mapbase_matchers_base.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
// memdbgon must be the last include file in a .cpp file!!!
|
// memdbgon must be the last include file in a .cpp file!!!
|
||||||
#include "tier0/memdbgon.h"
|
#include "tier0/memdbgon.h"
|
||||||
|
|
||||||
|
@ -18,7 +18,9 @@
|
|||||||
#include "collisionutils.h"
|
#include "collisionutils.h"
|
||||||
#include "tier0/vprof.h"
|
#include "tier0/vprof.h"
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
|
#ifdef HL2_DLL
|
||||||
#include "weapon_flaregun.h"
|
#include "weapon_flaregun.h"
|
||||||
|
#endif
|
||||||
#include "mapbase/GlobalStrings.h"
|
#include "mapbase/GlobalStrings.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1417,6 +1419,7 @@ void CEnvFireSensor::Think()
|
|||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
if (HasSpawnFlags(SF_FIRESENSOR_ACCEPT_FLARES))
|
if (HasSpawnFlags(SF_FIRESENSOR_ACCEPT_FLARES))
|
||||||
{
|
{
|
||||||
|
#ifdef HL2_DLL
|
||||||
// Also look for nearby flares
|
// Also look for nearby flares
|
||||||
CBaseEntity *pEntity = gEntList.FindEntityByClassnameWithin( NULL, "env_flare", GetAbsOrigin(), m_radius );
|
CBaseEntity *pEntity = gEntList.FindEntityByClassnameWithin( NULL, "env_flare", GetAbsOrigin(), m_radius );
|
||||||
while (pEntity)
|
while (pEntity)
|
||||||
@ -1429,6 +1432,7 @@ void CEnvFireSensor::Think()
|
|||||||
|
|
||||||
pEntity = gEntList.FindEntityByClassnameWithin( pEntity, "env_flare", GetAbsOrigin(), m_radius );
|
pEntity = gEntList.FindEntityByClassnameWithin( pEntity, "env_flare", GetAbsOrigin(), m_radius );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ public: // CBaseGameSystem overrides
|
|||||||
virtual void Shutdown();
|
virtual void Shutdown();
|
||||||
virtual void FrameUpdatePostEntityThink();
|
virtual void FrameUpdatePostEntityThink();
|
||||||
virtual void LevelInitPostEntity();
|
virtual void LevelInitPostEntity();
|
||||||
virtual const char *GetFixedCameraEntityName( void ) { return "point_viewcontrol"; }
|
virtual char *GetFixedCameraEntityName( void ) { return "point_viewcontrol"; }
|
||||||
|
|
||||||
bool SetCameraMan( int iPlayerIndex );
|
bool SetCameraMan( int iPlayerIndex );
|
||||||
int GetCameraMan() { return m_iCameraManIndex; }
|
int GetCameraMan() { return m_iCameraManIndex; }
|
||||||
|
@ -34,6 +34,9 @@ IMPLEMENT_SERVERCLASS_ST_NOBASE(CParticleSystem, DT_ParticleSystem)
|
|||||||
SendPropArray3( SENDINFO_ARRAY3(m_vControlPointVecs), SendPropVector( SENDINFO_ARRAY(m_vControlPointVecs) ) ),
|
SendPropArray3( SENDINFO_ARRAY3(m_vControlPointVecs), SendPropVector( SENDINFO_ARRAY(m_vControlPointVecs) ) ),
|
||||||
SendPropArray3( SENDINFO_ARRAY3(m_iControlPointParents), SendPropInt( SENDINFO_ARRAY(m_iControlPointParents), 3, SPROP_UNSIGNED ) ),
|
SendPropArray3( SENDINFO_ARRAY3(m_iControlPointParents), SendPropInt( SENDINFO_ARRAY(m_iControlPointParents), 3, SPROP_UNSIGNED ) ),
|
||||||
SendPropBool( SENDINFO(m_bWeatherEffect) ),
|
SendPropBool( SENDINFO(m_bWeatherEffect) ),
|
||||||
|
#ifdef MAPBASE
|
||||||
|
SendPropBool( SENDINFO(m_bUsesCoordinates) ),
|
||||||
|
#endif
|
||||||
END_SEND_TABLE()
|
END_SEND_TABLE()
|
||||||
|
|
||||||
BEGIN_DATADESC( CParticleSystem )
|
BEGIN_DATADESC( CParticleSystem )
|
||||||
@ -140,6 +143,9 @@ LINK_ENTITY_TO_CLASS( info_particle_system_coordinate, CParticleSystemCoordinate
|
|||||||
CParticleSystem::CParticleSystem()
|
CParticleSystem::CParticleSystem()
|
||||||
{
|
{
|
||||||
m_bWeatherEffect = false;
|
m_bWeatherEffect = false;
|
||||||
|
#ifdef MAPBASE
|
||||||
|
m_bDestroyImmediately = false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -284,6 +290,7 @@ void CParticleSystem::ReadControlPointEnts( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_hControlPointEnts.Set( i, pPointEnt );
|
m_hControlPointEnts.Set( i, pPointEnt );
|
||||||
|
m_bUsesCoordinates = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,9 @@ protected:
|
|||||||
CNetworkArray( Vector, m_vControlPointVecs, kMAXCONTROLPOINTS );
|
CNetworkArray( Vector, m_vControlPointVecs, kMAXCONTROLPOINTS );
|
||||||
CNetworkArray( unsigned char, m_iControlPointParents, kMAXCONTROLPOINTS );
|
CNetworkArray( unsigned char, m_iControlPointParents, kMAXCONTROLPOINTS );
|
||||||
CNetworkVar( bool, m_bWeatherEffect );
|
CNetworkVar( bool, m_bWeatherEffect );
|
||||||
|
#ifdef MAPBASE
|
||||||
|
CNetworkVar( bool, m_bUsesCoordinates );
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -86,10 +86,13 @@
|
|||||||
#include "weapon_physcannon.h"
|
#include "weapon_physcannon.h"
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
#include "mapbase/GlobalStrings.h"
|
#include "mapbase/GlobalStrings.h"
|
||||||
#include "mapbase/matchers.h"
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MAPBASE
|
||||||
|
#include "mapbase/matchers.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
#ifdef MAPBASE_VSCRIPT
|
||||||
#include "mapbase/vscript_funcs_shared.h"
|
#include "mapbase/vscript_funcs_shared.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -52,15 +52,15 @@ $Project
|
|||||||
$File "$SRCDIR\game\shared\mapbase\vscript_funcs_shared.h" [$MAPBASE_VSCRIPT]
|
$File "$SRCDIR\game\shared\mapbase\vscript_funcs_shared.h" [$MAPBASE_VSCRIPT]
|
||||||
$File "$SRCDIR\game\shared\mapbase\vscript_singletons.cpp" [$MAPBASE_VSCRIPT]
|
$File "$SRCDIR\game\shared\mapbase\vscript_singletons.cpp" [$MAPBASE_VSCRIPT]
|
||||||
$File "$SRCDIR\game\shared\mapbase\vscript_singletons.h" [$MAPBASE_VSCRIPT]
|
$File "$SRCDIR\game\shared\mapbase\vscript_singletons.h" [$MAPBASE_VSCRIPT]
|
||||||
$File "$SRCDIR\game\shared\mapbase\vscript_funcs_hl2.cpp" [$MAPBASE_VSCRIPT]
|
$File "$SRCDIR\game\shared\mapbase\vscript_funcs_hl2.cpp" [$MAPBASE_VSCRIPT&&($HL2||$EPISODIC)]
|
||||||
$File "$SRCDIR\game\shared\mapbase\vscript_consts_shared.cpp" [$MAPBASE_VSCRIPT]
|
$File "$SRCDIR\game\shared\mapbase\vscript_consts_shared.cpp" [$MAPBASE_VSCRIPT]
|
||||||
$File "$SRCDIR\game\shared\mapbase\vscript_consts_weapons.cpp" [$MAPBASE_VSCRIPT]
|
$File "$SRCDIR\game\shared\mapbase\vscript_consts_weapons.cpp" [$MAPBASE_VSCRIPT]
|
||||||
$File "$SRCDIR\game\shared\mapbase\weapon_custom_scripted.cpp" [$MAPBASE_VSCRIPT]
|
$File "$SRCDIR\game\shared\mapbase\weapon_custom_scripted.cpp" [$MAPBASE_VSCRIPT]
|
||||||
$File "$SRCDIR\game\shared\mapbase\weapon_custom_scripted.h" [$MAPBASE_VSCRIPT]
|
$File "$SRCDIR\game\shared\mapbase\weapon_custom_scripted.h" [$MAPBASE_VSCRIPT]
|
||||||
$File "$SRCDIR\game\shared\mapbase\logic_script_client.cpp" [$MAPBASE_VSCRIPT]
|
$File "$SRCDIR\game\shared\mapbase\logic_script_client.cpp" [$MAPBASE_VSCRIPT]
|
||||||
|
|
||||||
$File "mapbase\ai_grenade.cpp"
|
$File "mapbase\ai_grenade.cpp" [$HL2||$EPISODIC]
|
||||||
$File "mapbase\ai_grenade.h"
|
$File "mapbase\ai_grenade.h" [$HL2||$EPISODIC]
|
||||||
$File "mapbase\ai_monitor.cpp"
|
$File "mapbase\ai_monitor.cpp"
|
||||||
$File "mapbase\ai_weaponmodifier.cpp"
|
$File "mapbase\ai_weaponmodifier.cpp"
|
||||||
$File "mapbase\custom_weapon_factory.cpp"
|
$File "mapbase\custom_weapon_factory.cpp"
|
||||||
@ -88,20 +88,20 @@ $Project
|
|||||||
$File "mapbase\SystemConvarMod.h"
|
$File "mapbase\SystemConvarMod.h"
|
||||||
$File "mapbase\variant_tools.h"
|
$File "mapbase\variant_tools.h"
|
||||||
$File "mapbase\vgui_text_display.cpp"
|
$File "mapbase\vgui_text_display.cpp"
|
||||||
$File "mapbase\weapon_custom_hl2.cpp"
|
$File "mapbase\weapon_custom_hl2.cpp" [$HL2||$EPISODIC]
|
||||||
|
|
||||||
$File "mapbase\logic_eventlistener.cpp"
|
$File "mapbase\logic_eventlistener.cpp"
|
||||||
$File "mapbase\logic_register_activator.cpp"
|
$File "mapbase\logic_register_activator.cpp"
|
||||||
}
|
}
|
||||||
|
|
||||||
$Folder "HL2 DLL"
|
$Folder "HL2 DLL" [$HL2||$EPISODIC]
|
||||||
{
|
{
|
||||||
// Original stunstick files are conditional'd out in the HL2 VPCs
|
// Original stunstick files are conditional'd out in the HL2 VPCs
|
||||||
$File "$SRCDIR\game\shared\hl2mp\weapon_stunstick.cpp"
|
$File "$SRCDIR\game\shared\hl2mp\weapon_stunstick.cpp"
|
||||||
$File "$SRCDIR\game\shared\hl2mp\weapon_stunstick.h"
|
$File "$SRCDIR\game\shared\hl2mp\weapon_stunstick.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
$Folder "HL2MP"
|
$Folder "HL2MP" [$HL2||$EPISODIC]
|
||||||
{
|
{
|
||||||
$Folder "Weapons"
|
$Folder "Weapons"
|
||||||
{
|
{
|
||||||
|
@ -31,9 +31,14 @@ ConVar tf_show_incursion_range_max( "tf_show_incursion_range_max", "0", FCVAR_CH
|
|||||||
// Script access to manipulate the nav
|
// Script access to manipulate the nav
|
||||||
//--------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#ifndef MAPBASE_VSCRIPT // TODO: Need better way of supporting this
|
||||||
DEFINE_SCRIPT_INSTANCE_HELPER( CTFNavArea, &g_NavAreaScriptInstanceHelper )
|
DEFINE_SCRIPT_INSTANCE_HELPER( CTFNavArea, &g_NavAreaScriptInstanceHelper )
|
||||||
|
#endif
|
||||||
|
|
||||||
BEGIN_ENT_SCRIPTDESC_ROOT( CTFNavArea, "Navigation areas class" )
|
BEGIN_ENT_SCRIPTDESC_ROOT( CTFNavArea, "Navigation areas class" )
|
||||||
|
#ifdef MAPBASE_VSCRIPT
|
||||||
|
DEFINE_SCRIPT_INSTANCE_HELPER( &g_NavAreaScriptInstanceHelper )
|
||||||
|
#endif
|
||||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetID, "GetID", "Get area ID." )
|
DEFINE_SCRIPTFUNC_NAMED( ScriptGetID, "GetID", "Get area ID." )
|
||||||
DEFINE_SCRIPTFUNC( GetAttributes, "Get area attribute bits" )
|
DEFINE_SCRIPTFUNC( GetAttributes, "Get area attribute bits" )
|
||||||
DEFINE_SCRIPTFUNC( SetAttributes, "Set area attribute bits" )
|
DEFINE_SCRIPTFUNC( SetAttributes, "Set area attribute bits" )
|
||||||
|
@ -1420,7 +1420,6 @@ static CBaseEntity *VScript_ParseEntity( const char *pszClassname, HSCRIPT hSpaw
|
|||||||
return pEntity;
|
return pEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef MAPBASE_VSCRIPT // See vscript_funcs_shared.cpp
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
CBaseEntity *ScriptCreateEntityFromTable( const char *pszClassname, HSCRIPT hSpawnTable )
|
CBaseEntity *ScriptCreateEntityFromTable( const char *pszClassname, HSCRIPT hSpawnTable )
|
||||||
{
|
{
|
||||||
@ -1436,6 +1435,7 @@ CBaseEntity *ScriptCreateEntityFromTable( const char *pszClassname, HSCRIPT hSpa
|
|||||||
return pEntity;
|
return pEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef MAPBASE_VSCRIPT // See vscript_funcs_shared.cpp
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
static HSCRIPT Script_SpawnEntityFromTable( const char *pszName, HSCRIPT spawn_table )
|
static HSCRIPT Script_SpawnEntityFromTable( const char *pszName, HSCRIPT spawn_table )
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
static char g_Script_vscript_client[] = R"vscript(
|
|
||||||
//========== Copyright © 2008, Valve Corporation, All rights reserved. ========
|
//========== Copyright © 2008, Valve Corporation, All rights reserved. ========
|
||||||
//
|
//
|
||||||
// Purpose:
|
// Purpose:
|
||||||
@ -296,7 +295,6 @@ function FireScriptEvent( event, params )
|
|||||||
__RunEventCallbacks( event, params, "OnScriptEvent_", "ScriptEventCallbacks", false )
|
__RunEventCallbacks( event, params, "OnScriptEvent_", "ScriptEventCallbacks", false )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Debug watches & trace
|
// Debug watches & trace
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -778,4 +776,3 @@ function EndScriptDebug()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
)vscript";
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
//=============================================================================//
|
//=============================================================================//
|
||||||
#include "cbase.h"
|
#include "cbase.h"
|
||||||
#include "func_ladder.h"
|
#include "func_ladder.h"
|
||||||
#ifdef MAPBASE
|
#if defined(MAPBASE) && (defined(HL2_DLL) || defined(HL2_CLIENT_DLL))
|
||||||
#include "hl_gamemovement.h"
|
#include "hl_gamemovement.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -16,7 +16,7 @@
|
|||||||
/*static*/ ConVar sv_showladders( "sv_showladders", "0", 0, "Show bbox and dismount points for all ladders (must be set before level load.)\n" );
|
/*static*/ ConVar sv_showladders( "sv_showladders", "0", 0, "Show bbox and dismount points for all ladders (must be set before level load.)\n" );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MAPBASE
|
#if defined(MAPBASE) && (defined(HL2_DLL) || defined(HL2_CLIENT_DLL))
|
||||||
extern IGameMovement *g_pGameMovement;
|
extern IGameMovement *g_pGameMovement;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -415,7 +415,11 @@ void CFuncLadder::InputDisable( inputdata_t &inputdata )
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void CFuncLadder::InputForcePlayerOn( inputdata_t &inputdata )
|
void CFuncLadder::InputForcePlayerOn( inputdata_t &inputdata )
|
||||||
{
|
{
|
||||||
|
#if (defined(HL2_DLL) || defined(HL2_CLIENT_DLL))
|
||||||
static_cast<CHL2GameMovement*>(g_pGameMovement)->ForcePlayerOntoLadder(this);
|
static_cast<CHL2GameMovement*>(g_pGameMovement)->ForcePlayerOntoLadder(this);
|
||||||
|
#else
|
||||||
|
Warning( "This game does not support ForcePlayerOn\n" );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -424,7 +428,11 @@ void CFuncLadder::InputForcePlayerOn( inputdata_t &inputdata )
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void CFuncLadder::InputCheckPlayerOn( inputdata_t &inputdata )
|
void CFuncLadder::InputCheckPlayerOn( inputdata_t &inputdata )
|
||||||
{
|
{
|
||||||
|
#if (defined(HL2_DLL) || defined(HL2_CLIENT_DLL))
|
||||||
static_cast<CHL2GameMovement*>(g_pGameMovement)->MountPlayerOntoLadder(this);
|
static_cast<CHL2GameMovement*>(g_pGameMovement)->MountPlayerOntoLadder(this);
|
||||||
|
#else
|
||||||
|
Warning( "This game does not support CheckPlayerOn\n" );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -56,7 +56,9 @@ ConVar mapbase_flush_talker("mapbase_flush_talker", "1", FCVAR_NONE, "Normally,
|
|||||||
|
|
||||||
extern void MapbaseGameLog_Init();
|
extern void MapbaseGameLog_Init();
|
||||||
|
|
||||||
|
#ifdef HL2_DLL
|
||||||
extern void ParseCustomActbusyFile(const char *file);
|
extern void ParseCustomActbusyFile(const char *file);
|
||||||
|
#endif
|
||||||
|
|
||||||
extern bool LoadResponseSystemFile(const char *scriptfile);
|
extern bool LoadResponseSystemFile(const char *scriptfile);
|
||||||
extern void ReloadResponseSystem();
|
extern void ReloadResponseSystem();
|
||||||
@ -466,8 +468,10 @@ public:
|
|||||||
} break;
|
} break;
|
||||||
//case MANIFEST_SOUNDSCAPES: { g_SoundscapeSystem.AddSoundscapeFile(value); } break;
|
//case MANIFEST_SOUNDSCAPES: { g_SoundscapeSystem.AddSoundscapeFile(value); } break;
|
||||||
//case MANIFEST_SENTENCES: { engine->PrecacheSentenceFile(value); } break;
|
//case MANIFEST_SENTENCES: { engine->PrecacheSentenceFile(value); } break;
|
||||||
|
#ifdef HL2_DLL
|
||||||
case MANIFEST_ACTBUSY: { ParseCustomActbusyFile(value); } break;
|
case MANIFEST_ACTBUSY: { ParseCustomActbusyFile(value); } break;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
#ifdef MAPBASE_VSCRIPT
|
#ifdef MAPBASE_VSCRIPT
|
||||||
case MANIFEST_VSCRIPT: { VScriptRunScript(value, false); } break;
|
case MANIFEST_VSCRIPT: { VScriptRunScript(value, false); } break;
|
||||||
#endif
|
#endif
|
||||||
|
@ -1398,14 +1398,14 @@ void CTeamRoundTimer::InputAddTeamTime( inputdata_t &input )
|
|||||||
int nSeconds = 0;
|
int nSeconds = 0;
|
||||||
|
|
||||||
// get the team
|
// get the team
|
||||||
p = nexttoken( token, p, ' ', sizeof(token) );
|
p = nexttoken( token, p, ' ' );
|
||||||
if ( token[0] )
|
if ( token[0] )
|
||||||
{
|
{
|
||||||
nTeam = Q_atoi( token );
|
nTeam = Q_atoi( token );
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the time
|
// get the time
|
||||||
p = nexttoken( token, p, ' ', sizeof(token) );
|
p = nexttoken( token, p, ' ' );
|
||||||
if ( token[0] )
|
if ( token[0] )
|
||||||
{
|
{
|
||||||
nSeconds = Q_atoi( token );
|
nSeconds = Q_atoi( token );
|
||||||
|
@ -1359,7 +1359,7 @@ char *UTIL_GetFilteredChatText( int iPlayerIndex, char *pszText, int nTextBuffer
|
|||||||
}
|
}
|
||||||
#endif // CLIENT_DLL
|
#endif // CLIENT_DLL
|
||||||
|
|
||||||
const char* ReadAndAllocStringValue( KeyValues *pSub, const char *pName, const char *pFilename )
|
char* ReadAndAllocStringValue( KeyValues *pSub, const char *pName, const char *pFilename )
|
||||||
{
|
{
|
||||||
const char *pValue = pSub->GetString( pName, NULL );
|
const char *pValue = pSub->GetString( pName, NULL );
|
||||||
if ( !pValue )
|
if ( !pValue )
|
||||||
|
@ -663,7 +663,7 @@ class RealTimeCountdownTimer : public CountdownTimer
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const char* ReadAndAllocStringValue( KeyValues *pSub, const char *pName, const char *pFilename = NULL );
|
char* ReadAndAllocStringValue( KeyValues *pSub, const char *pName, const char *pFilename = NULL );
|
||||||
|
|
||||||
int UTIL_StringFieldToInt( const char *szValue, const char **pValueStrings, int iNumStrings );
|
int UTIL_StringFieldToInt( const char *szValue, const char **pValueStrings, int iNumStrings );
|
||||||
|
|
||||||
|
@ -582,7 +582,11 @@ inline IScriptInstanceHelper *GetScriptInstanceHelper_ScriptNoBase_t()
|
|||||||
#define DEFINE_SCRIPTFUNC_WRAPPED( func, description ) DEFINE_SCRIPTFUNC_NAMED( SCRIPTFUNC_CONCAT( Script, func ), #func, description )
|
#define DEFINE_SCRIPTFUNC_WRAPPED( func, description ) DEFINE_SCRIPTFUNC_NAMED( SCRIPTFUNC_CONCAT( Script, func ), #func, description )
|
||||||
#define DEFINE_SCRIPTFUNC_NAMED( func, scriptName, description ) ScriptAddFunctionToClassDescNamed( pDesc, _className, func, scriptName, description );
|
#define DEFINE_SCRIPTFUNC_NAMED( func, scriptName, description ) ScriptAddFunctionToClassDescNamed( pDesc, _className, func, scriptName, description );
|
||||||
#define DEFINE_SCRIPT_CONSTRUCTOR() ScriptAddConstructorToClassDesc( pDesc, _className );
|
#define DEFINE_SCRIPT_CONSTRUCTOR() ScriptAddConstructorToClassDesc( pDesc, _className );
|
||||||
|
#ifdef MAPBASE_VSCRIPT
|
||||||
#define DEFINE_SCRIPT_INSTANCE_HELPER( p ) pDesc->pHelper = (p);
|
#define DEFINE_SCRIPT_INSTANCE_HELPER( p ) pDesc->pHelper = (p);
|
||||||
|
#else
|
||||||
|
#define DEFINE_SCRIPT_INSTANCE_HELPER( className, p ) template <> IScriptInstanceHelper *GetScriptInstanceHelperOverride< className >( IScriptInstanceHelper * ) { return p; }
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef MAPBASE_VSCRIPT
|
#ifdef MAPBASE_VSCRIPT
|
||||||
// Use this for hooks which have no parameters
|
// Use this for hooks which have no parameters
|
||||||
|
@ -1090,13 +1090,17 @@ bool CreateParamCheck(const ScriptFunctionBinding_t& func, char* output)
|
|||||||
switch (func.m_desc.m_Parameters[i])
|
switch (func.m_desc.m_Parameters[i])
|
||||||
{
|
{
|
||||||
case FIELD_FLOAT:
|
case FIELD_FLOAT:
|
||||||
|
case FIELD_FLOAT64:
|
||||||
case FIELD_INTEGER:
|
case FIELD_INTEGER:
|
||||||
|
case FIELD_UINT:
|
||||||
|
case FIELD_UINT64:
|
||||||
*output++ = 'n';
|
*output++ = 'n';
|
||||||
break;
|
break;
|
||||||
case FIELD_CSTRING:
|
case FIELD_CSTRING:
|
||||||
*output++ = 's';
|
*output++ = 's';
|
||||||
break;
|
break;
|
||||||
case FIELD_VECTOR:
|
case FIELD_VECTOR:
|
||||||
|
case FIELD_QANGLE:
|
||||||
*output++ = 'x'; // Generic instance, we validate on arrival
|
*output++ = 'x'; // Generic instance, we validate on arrival
|
||||||
break;
|
break;
|
||||||
case FIELD_BOOLEAN:
|
case FIELD_BOOLEAN:
|
||||||
@ -1137,6 +1141,7 @@ void PushVariant(HSQUIRRELVM vm, const ScriptVariant_t& value)
|
|||||||
sq_pushnull(vm);
|
sq_pushnull(vm);
|
||||||
break;
|
break;
|
||||||
case FIELD_VECTOR:
|
case FIELD_VECTOR:
|
||||||
|
case FIELD_QANGLE:
|
||||||
{
|
{
|
||||||
SquirrelVM* pSquirrelVM = (SquirrelVM*)sq_getforeignptr(vm);
|
SquirrelVM* pSquirrelVM = (SquirrelVM*)sq_getforeignptr(vm);
|
||||||
assert(pSquirrelVM);
|
assert(pSquirrelVM);
|
||||||
@ -1196,6 +1201,7 @@ void GetVariantScriptString(const ScriptVariant_t& value, char *szValue, int iSi
|
|||||||
V_snprintf( szValue, iSize, "\"%s\"", value.m_pszString );
|
V_snprintf( szValue, iSize, "\"%s\"", value.m_pszString );
|
||||||
break;
|
break;
|
||||||
case FIELD_VECTOR:
|
case FIELD_VECTOR:
|
||||||
|
case FIELD_QANGLE: // Could show "QAngle" instead, but Mapbase VScript never did that
|
||||||
V_snprintf( szValue, iSize, "Vector( %f, %f, %f )", value.m_pVector->x, value.m_pVector->y, value.m_pVector->z );
|
V_snprintf( szValue, iSize, "Vector( %f, %f, %f )", value.m_pVector->x, value.m_pVector->y, value.m_pVector->z );
|
||||||
break;
|
break;
|
||||||
case FIELD_INTEGER:
|
case FIELD_INTEGER:
|
||||||
@ -1343,6 +1349,7 @@ SQInteger function_stub(HSQUIRRELVM vm)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case FIELD_VECTOR:
|
case FIELD_VECTOR:
|
||||||
|
case FIELD_QANGLE:
|
||||||
{
|
{
|
||||||
Vector* val;
|
Vector* val;
|
||||||
if (SQ_FAILED(sq_getinstanceup(vm, i + 2, (SQUserPointer*)&val, TYPETAG_VECTOR)))
|
if (SQ_FAILED(sq_getinstanceup(vm, i + 2, (SQUserPointer*)&val, TYPETAG_VECTOR)))
|
||||||
@ -1433,7 +1440,7 @@ SQInteger function_stub(HSQUIRRELVM vm)
|
|||||||
|
|
||||||
PushVariant(vm, retval);
|
PushVariant(vm, retval);
|
||||||
|
|
||||||
if (retval.m_type == FIELD_VECTOR)
|
if (retval.m_type == FIELD_VECTOR || retval.m_type == FIELD_QANGLE)
|
||||||
delete retval.m_pVector;
|
delete retval.m_pVector;
|
||||||
|
|
||||||
return pFunc->m_desc.m_ReturnType != FIELD_VOID;
|
return pFunc->m_desc.m_ReturnType != FIELD_VOID;
|
||||||
@ -1753,23 +1760,6 @@ void errorfunc(HSQUIRRELVM SQ_UNUSED_ARG(v), const SQChar* format, ...)
|
|||||||
Warning("%s", buffer);
|
Warning("%s", buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * ScriptDataTypeToName(ScriptDataType_t datatype)
|
|
||||||
{
|
|
||||||
switch (datatype)
|
|
||||||
{
|
|
||||||
case FIELD_VOID: return "void";
|
|
||||||
case FIELD_FLOAT: return "float";
|
|
||||||
case FIELD_CSTRING: return "string";
|
|
||||||
case FIELD_VECTOR: return "Vector";
|
|
||||||
case FIELD_INTEGER: return "int";
|
|
||||||
case FIELD_BOOLEAN: return "bool";
|
|
||||||
case FIELD_CHARACTER: return "char";
|
|
||||||
case FIELD_HSCRIPT: return "handle";
|
|
||||||
case FIELD_VARIANT: return "variant";
|
|
||||||
default: return "<unknown>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#define PushDocumentationRegisterFunction( szName ) \
|
#define PushDocumentationRegisterFunction( szName ) \
|
||||||
sq_pushroottable(vm); \
|
sq_pushroottable(vm); \
|
||||||
@ -1805,14 +1795,14 @@ void RegisterDocumentation(HSQUIRRELVM vm, const ScriptFuncDescriptor_t& pFuncDe
|
|||||||
|
|
||||||
|
|
||||||
char signature[256] = "";
|
char signature[256] = "";
|
||||||
V_snprintf(signature, sizeof(signature), "%s %s(", ScriptDataTypeToName(pFuncDesc.m_ReturnType), name);
|
V_snprintf(signature, sizeof(signature), "%s %s(", VariantFieldTypeName(pFuncDesc.m_ReturnType), name);
|
||||||
|
|
||||||
for (int i = 0; i < pFuncDesc.m_Parameters.Count(); ++i)
|
for (int i = 0; i < pFuncDesc.m_Parameters.Count(); ++i)
|
||||||
{
|
{
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
V_strcat_safe(signature, ", ");
|
V_strcat_safe(signature, ", ");
|
||||||
|
|
||||||
V_strcat_safe(signature, ScriptDataTypeToName(pFuncDesc.m_Parameters[i]));
|
V_strcat_safe(signature, VariantFieldTypeName(pFuncDesc.m_Parameters[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
V_strcat_safe(signature, ")");
|
V_strcat_safe(signature, ")");
|
||||||
@ -1901,7 +1891,7 @@ void RegisterConstantDocumentation( HSQUIRRELVM vm, const ScriptConstantBinding_
|
|||||||
V_strcat_safe(name, pConstDesc->m_pszScriptName);
|
V_strcat_safe(name, pConstDesc->m_pszScriptName);
|
||||||
|
|
||||||
char signature[256] = "";
|
char signature[256] = "";
|
||||||
V_snprintf(signature, sizeof(signature), "%s (%s)", pszAsString, ScriptDataTypeToName(pConstDesc->m_data.m_type));
|
V_snprintf(signature, sizeof(signature), "%s (%s)", pszAsString, VariantFieldTypeName(pConstDesc->m_data.m_type));
|
||||||
|
|
||||||
// RegisterConstHelp(name, signature, description)
|
// RegisterConstHelp(name, signature, description)
|
||||||
PushDocumentationRegisterFunction( "RegisterConstHelp" );
|
PushDocumentationRegisterFunction( "RegisterConstHelp" );
|
||||||
@ -1933,14 +1923,14 @@ void RegisterHookDocumentation(HSQUIRRELVM vm, const ScriptHook_t* pHook, const
|
|||||||
|
|
||||||
|
|
||||||
char signature[256] = "";
|
char signature[256] = "";
|
||||||
V_snprintf(signature, sizeof(signature), "%s %s(", ScriptDataTypeToName(pFuncDesc.m_ReturnType), name);
|
V_snprintf(signature, sizeof(signature), "%s %s(", VariantFieldTypeName(pFuncDesc.m_ReturnType), name);
|
||||||
|
|
||||||
for (int i = 0; i < pFuncDesc.m_Parameters.Count(); ++i)
|
for (int i = 0; i < pFuncDesc.m_Parameters.Count(); ++i)
|
||||||
{
|
{
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
V_strcat_safe(signature, ", ");
|
V_strcat_safe(signature, ", ");
|
||||||
|
|
||||||
V_strcat_safe(signature, ScriptDataTypeToName(pFuncDesc.m_Parameters[i]));
|
V_strcat_safe(signature, VariantFieldTypeName(pFuncDesc.m_Parameters[i]));
|
||||||
V_strcat_safe(signature, " [");
|
V_strcat_safe(signature, " [");
|
||||||
V_strcat_safe(signature, pHook->m_pszParameterNames[i]);
|
V_strcat_safe(signature, pHook->m_pszParameterNames[i]);
|
||||||
V_strcat_safe(signature, "]");
|
V_strcat_safe(signature, "]");
|
||||||
@ -1978,7 +1968,7 @@ void RegisterMemberDocumentation(HSQUIRRELVM vm, const ScriptMemberDesc_t& pDesc
|
|||||||
V_strcat_safe(name, pDesc.m_pszScriptName);
|
V_strcat_safe(name, pDesc.m_pszScriptName);
|
||||||
|
|
||||||
char signature[256] = "";
|
char signature[256] = "";
|
||||||
V_snprintf(signature, sizeof(signature), "%s %s", ScriptDataTypeToName(pDesc.m_ReturnType), name);
|
V_snprintf(signature, sizeof(signature), "%s %s", VariantFieldTypeName(pDesc.m_ReturnType), name);
|
||||||
|
|
||||||
// RegisterMemberHelp(name, signature, description)
|
// RegisterMemberHelp(name, signature, description)
|
||||||
PushDocumentationRegisterFunction( "RegisterMemberHelp" );
|
PushDocumentationRegisterFunction( "RegisterMemberHelp" );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user