mirror of
https://github.com/fortressforever/fortressforever-2013.git
synced 2024-11-22 20:41:14 +00:00
Made everything comply with the naming scheme we're going with (subject to change?)
- All classes are named CFF_<CL/SV/SH>_ClassName - All files are named ff_<cl/sv/sh>_filename Conflicts: mp/src/game/shared/ff/ff_sh_scriptman.h
This commit is contained in:
parent
03ec8eec87
commit
2c2d486a9d
25 changed files with 232 additions and 225 deletions
|
@ -569,7 +569,7 @@ private:
|
|||
friend class CDODGameMovement;
|
||||
friend class CPortalGameMovement;
|
||||
// FF -->
|
||||
friend class C_FF_SH_GameMovement;
|
||||
friend class CFF_SH_GameMovement;
|
||||
// FF <--
|
||||
|
||||
// Accessors for gamemovement
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "gamestringpool.h"
|
||||
|
||||
#ifdef HL2MP
|
||||
#include "ff_gamerules_shared.h"
|
||||
#include "ff_sh_gamerules.h"
|
||||
#endif
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "c_hl2mp_player.h"
|
||||
#include "view.h"
|
||||
#include "takedamageinfo.h"
|
||||
#include "ff_gamerules_shared.h"
|
||||
#include "ff_sh_gamerules.h"
|
||||
#include "in_buttons.h"
|
||||
#include "iviewrender_beams.h" // flashlight beam
|
||||
#include "r_efx.h"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "c_team.h"
|
||||
#include "c_playerresource.h"
|
||||
#include "c_hl2mp_player.h"
|
||||
#include "ff_gamerules_shared.h"
|
||||
#include "ff_sh_gamerules.h"
|
||||
#include "ihudlcd.h"
|
||||
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "vgui_entitypanel.h"
|
||||
#include "iclientmode.h"
|
||||
#include "vgui/ILocalize.h"
|
||||
#include "ff_gamerules_shared.h"
|
||||
#include "ff_sh_gamerules.h"
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "vgui_entitypanel.h"
|
||||
#include "iclientmode.h"
|
||||
#include "vgui/ILocalize.h"
|
||||
#include "ff_gamerules_shared.h"
|
||||
#include "ff_sh_gamerules.h"
|
||||
#include "c_team.h"
|
||||
#include <vgui_controls/AnimationController.h>
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "c_team.h"
|
||||
#include "c_playerresource.h"
|
||||
#include "c_hl2mp_player.h"
|
||||
#include "ff_gamerules_shared.h"
|
||||
#include "ff_sh_gamerules.h"
|
||||
|
||||
#include <KeyValues.h>
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "func_break.h"
|
||||
|
||||
#ifdef HL2MP
|
||||
#include "ff_gamerules_shared.h"
|
||||
#include "ff_sh_gamerules.h"
|
||||
#endif
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#include "cbase.h"
|
||||
#include "hl2mp_player.h"
|
||||
#include "ff_gamerules_shared.h"
|
||||
#include "ff_sh_gamerules.h"
|
||||
#include "gamerules.h"
|
||||
#include "teamplay_gamerules.h"
|
||||
#include "entitylist.h"
|
||||
|
@ -196,6 +196,6 @@ void GameStartFrame( void )
|
|||
void InstallGameRules()
|
||||
{
|
||||
// vanilla deathmatch
|
||||
CreateGameRulesObject( "CFFRules" );
|
||||
CreateGameRulesObject( "CFF_SH_Rules" );
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
#include "cbase.h"
|
||||
#include "gameinterface.h"
|
||||
#include "mapentities.h"
|
||||
#include "ff_gameinterface.h"
|
||||
#include "ff_sv_gameinterface.h"
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
|
@ -1,6 +1,6 @@
|
|||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
#ifndef FF_GAMEINTERFACE_H
|
||||
#define FF_GAMEINTERFACE_H
|
||||
#ifndef FF_SV_GAMEINTERFACE_H
|
||||
#define FF_SV_GAMEINTERFACE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
|
@ -13,7 +13,7 @@
|
|||
#include "hl2mp_player_shared.h"
|
||||
#include "predicted_viewmodel.h"
|
||||
#include "in_buttons.h"
|
||||
#include "ff_gamerules_shared.h"
|
||||
#include "ff_sh_gamerules.h"
|
||||
#include "KeyValues.h"
|
||||
#include "team.h"
|
||||
#include "weapon_hl2mpbase.h"
|
||||
|
|
|
@ -17,7 +17,7 @@ class CHL2MP_Player;
|
|||
#include "simtimer.h"
|
||||
#include "soundenvelope.h"
|
||||
#include "hl2mp_player_shared.h"
|
||||
#include "ff_gamerules_shared.h"
|
||||
#include "ff_sh_gamerules.h"
|
||||
#include "utldict.h"
|
||||
|
||||
//=============================================================================
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include "world.h"
|
||||
|
||||
#ifdef HL2MP
|
||||
#include "ff_gamerules_shared.h"
|
||||
#include "ff_sh_gamerules.h"
|
||||
#endif
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
|
|
|
@ -1138,7 +1138,7 @@ protected:
|
|||
friend class CDODGameMovement;
|
||||
friend class CPortalGameMovement;
|
||||
// FF -->
|
||||
friend class C_FF_SH_GameMovement;
|
||||
friend class CFF_SH_GameMovement;
|
||||
// FF <--
|
||||
|
||||
// Accessors for gamemovement
|
||||
|
|
|
@ -34,9 +34,9 @@ $Project "Server (FF)"
|
|||
// for FF Shared, see game\shared\ff\ff_shared.vpc
|
||||
$Folder "FF"
|
||||
{
|
||||
$File "FF\ff_client.cpp"
|
||||
$File "FF\ff_gameinterface.cpp"
|
||||
$File "FF\ff_gameinterface.h"
|
||||
$File "FF\ff_sv_client.cpp"
|
||||
$File "FF\ff_sv_gameinterface.cpp"
|
||||
$File "FF\ff_sv_gameinterface.h"
|
||||
|
||||
$Folder "Libraries"
|
||||
{
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include "gameweaponmanager.h"
|
||||
|
||||
#ifdef HL2MP
|
||||
#include "ff_gamerules_shared.h"
|
||||
#include "ff_sh_gamerules.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -11,7 +11,7 @@ ConVar sv_sharkingfriction("sv_sharkingfriction", "1", FCVAR_REPLICATED);
|
|||
#define SV_SHARKINGFRICTION sv_sharkingfriction.GetFloat()
|
||||
|
||||
// debug purposes
|
||||
void C_FF_SH_GameMovement::PlayerMove( void )
|
||||
void CFF_SH_GameMovement::PlayerMove( void )
|
||||
{
|
||||
static float flLastSurfaceFriction = -1.0f;
|
||||
if (player->m_surfaceFriction != flLastSurfaceFriction)
|
||||
|
@ -23,7 +23,7 @@ void C_FF_SH_GameMovement::PlayerMove( void )
|
|||
BaseClass::PlayerMove();
|
||||
}
|
||||
|
||||
void C_FF_SH_GameMovement::OnLand( float flFallVelocity )
|
||||
void CFF_SH_GameMovement::OnLand( float flFallVelocity )
|
||||
{
|
||||
BaseClass::OnLand( flFallVelocity );
|
||||
|
||||
|
@ -58,7 +58,7 @@ void C_FF_SH_GameMovement::OnLand( float flFallVelocity )
|
|||
*/
|
||||
}
|
||||
|
||||
void C_FF_SH_GameMovement::PlayerRoughLandingEffects( float fvol )
|
||||
void CFF_SH_GameMovement::PlayerRoughLandingEffects( float fvol )
|
||||
{
|
||||
if ( fvol > 0.0 )
|
||||
{
|
||||
|
@ -106,7 +106,7 @@ void C_FF_SH_GameMovement::PlayerRoughLandingEffects( float fvol )
|
|||
}
|
||||
}
|
||||
|
||||
void C_FF_SH_GameMovement::FinishUnDuck( void )
|
||||
void CFF_SH_GameMovement::FinishUnDuck( void )
|
||||
{
|
||||
int i;
|
||||
trace_t trace;
|
||||
|
@ -189,7 +189,7 @@ void C_FF_SH_GameMovement::FinishUnDuck( void )
|
|||
*/
|
||||
}
|
||||
|
||||
void C_FF_SH_GameMovement::Duck( void )
|
||||
void CFF_SH_GameMovement::Duck( void )
|
||||
{
|
||||
// FF TODO: Port these changes, this function was totally rewritten
|
||||
/*
|
||||
|
@ -507,7 +507,7 @@ void C_FF_SH_GameMovement::Duck( void )
|
|||
}
|
||||
|
||||
// Expose our interface.
|
||||
static C_FF_SH_GameMovement g_GameMovement;
|
||||
static CFF_SH_GameMovement g_GameMovement;
|
||||
IGameMovement *g_pGameMovement = ( IGameMovement * )&g_GameMovement;
|
||||
|
||||
EXPOSE_SINGLE_INTERFACE_GLOBALVAR( C_FF_SH_GameMovement, IGameMovement, INTERFACENAME_GAMEMOVEMENT, g_GameMovement );
|
||||
EXPOSE_SINGLE_INTERFACE_GLOBALVAR( CFF_SH_GameMovement, IGameMovement, INTERFACENAME_GAMEMOVEMENT, g_GameMovement );
|
|
@ -8,12 +8,12 @@
|
|||
|
||||
class CBasePlayer;
|
||||
|
||||
class C_FF_SH_GameMovement : public CGameMovement
|
||||
class CFF_SH_GameMovement : public CGameMovement
|
||||
{
|
||||
DECLARE_CLASS(C_FF_SH_GameMovement, CGameMovement);
|
||||
DECLARE_CLASS(CFF_SH_GameMovement, CGameMovement);
|
||||
|
||||
public:
|
||||
C_FF_SH_GameMovement() {};
|
||||
CFF_SH_GameMovement() {};
|
||||
|
||||
protected:
|
||||
/// Catches all landings
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
#include "cbase.h"
|
||||
#include "ff_gamerules_shared.h"
|
||||
#include "ff_sh_gamerules.h"
|
||||
#include "viewport_panel_names.h"
|
||||
#include "gameeventdefs.h"
|
||||
#include <KeyValues.h>
|
||||
|
@ -30,7 +30,7 @@
|
|||
#include "weapon_hl2mpbasehlmpcombatweapon.h"
|
||||
#include "team.h"
|
||||
#include "voice_gamemgr.h"
|
||||
#include "ff_gameinterface.h"
|
||||
#include "ff_sv_gameinterface.h"
|
||||
#include "hl2mp_cvars.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -55,9 +55,9 @@ extern CBaseEntity *g_pLastRebelSpawn;
|
|||
#endif
|
||||
|
||||
|
||||
REGISTER_GAMERULES_CLASS( CFFRules );
|
||||
REGISTER_GAMERULES_CLASS( CFF_SH_Rules );
|
||||
|
||||
BEGIN_NETWORK_TABLE_NOBASE( CFFRules, DT_FFRules )
|
||||
BEGIN_NETWORK_TABLE_NOBASE( CFF_SH_Rules, DT_FFRules )
|
||||
|
||||
#ifdef CLIENT_DLL
|
||||
RecvPropBool( RECVINFO( m_bTeamPlayEnabled ) ),
|
||||
|
@ -68,8 +68,12 @@ BEGIN_NETWORK_TABLE_NOBASE( CFFRules, DT_FFRules )
|
|||
END_NETWORK_TABLE()
|
||||
|
||||
|
||||
LINK_ENTITY_TO_CLASS( ff_gamerules, CFFGameRulesProxy );
|
||||
IMPLEMENT_NETWORKCLASS_ALIASED( FFGameRulesProxy, DT_FFGameRulesProxy )
|
||||
LINK_ENTITY_TO_CLASS( ff_gamerules, CFF_SH_GameRulesProxy );
|
||||
#ifdef CLIENT_DLL
|
||||
IMPLEMENT_CLIENTCLASS( CFF_CL_GameRulesProxy, DT_FFGameRulesProxy, CFF_SV_GameRulesProxy )
|
||||
#else
|
||||
IMPLEMENT_SERVERCLASS( CFF_SV_GameRulesProxy, DT_FFGameRulesProxy )
|
||||
#endif
|
||||
|
||||
static FFViewVectors g_FFViewVectors(
|
||||
Vector( 0, 0, 64 ), //VEC_VIEW (m_vView)
|
||||
|
@ -138,23 +142,23 @@ static const char *s_PreserveEnts[] =
|
|||
#ifdef CLIENT_DLL
|
||||
void RecvProxy_FFRules( const RecvProp *pProp, void **pOut, void *pData, int objectID )
|
||||
{
|
||||
CFFRules *pRules = FFRules();
|
||||
CFF_SH_Rules *pRules = FFRules();
|
||||
Assert( pRules );
|
||||
*pOut = pRules;
|
||||
}
|
||||
|
||||
BEGIN_RECV_TABLE( CFFGameRulesProxy, DT_FFGameRulesProxy )
|
||||
BEGIN_RECV_TABLE( CFF_SH_GameRulesProxy, DT_FFGameRulesProxy )
|
||||
RecvPropDataTable( "ff_gamerules_data", 0, 0, &REFERENCE_RECV_TABLE( DT_FFRules ), RecvProxy_FFRules )
|
||||
END_RECV_TABLE()
|
||||
#else
|
||||
void* SendProxy_FFRules( const SendProp *pProp, const void *pStructBase, const void *pData, CSendProxyRecipients *pRecipients, int objectID )
|
||||
{
|
||||
CFFRules *pRules = FFRules();
|
||||
CFF_SH_Rules *pRules = FFRules();
|
||||
Assert( pRules );
|
||||
return pRules;
|
||||
}
|
||||
|
||||
BEGIN_SEND_TABLE( CFFGameRulesProxy, DT_FFGameRulesProxy )
|
||||
BEGIN_SEND_TABLE( CFF_SH_GameRulesProxy, DT_FFGameRulesProxy )
|
||||
SendPropDataTable( "ff_gamerules_data", 0, &REFERENCE_SEND_TABLE( DT_FFRules ), SendProxy_FFRules )
|
||||
END_SEND_TABLE()
|
||||
#endif
|
||||
|
@ -183,7 +187,7 @@ char *sTeamNames[] =
|
|||
"Rebels",
|
||||
};
|
||||
|
||||
CFFRules::CFFRules()
|
||||
CFF_SH_Rules::CFF_SH_Rules()
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
// Create the team managers
|
||||
|
@ -210,17 +214,17 @@ CFFRules::CFFRules()
|
|||
#endif
|
||||
}
|
||||
|
||||
const CViewVectors* CFFRules::GetViewVectors()const
|
||||
const CViewVectors* CFF_SH_Rules::GetViewVectors()const
|
||||
{
|
||||
return &g_FFViewVectors;
|
||||
}
|
||||
|
||||
const FFViewVectors* CFFRules::GetFFViewVectors()const
|
||||
const FFViewVectors* CFF_SH_Rules::GetFFViewVectors()const
|
||||
{
|
||||
return &g_FFViewVectors;
|
||||
}
|
||||
|
||||
CFFRules::~CFFRules( void )
|
||||
CFF_SH_Rules::~CFF_SH_Rules( void )
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
// Note, don't delete each team since they are in the gEntList and will
|
||||
|
@ -229,7 +233,7 @@ CFFRules::~CFFRules( void )
|
|||
#endif
|
||||
}
|
||||
|
||||
void CFFRules::CreateStandardEntities( void )
|
||||
void CFF_SH_Rules::CreateStandardEntities( void )
|
||||
{
|
||||
|
||||
#ifndef CLIENT_DLL
|
||||
|
@ -252,7 +256,7 @@ void CFFRules::CreateStandardEntities( void )
|
|||
// FlWeaponRespawnTime - what is the time in the future
|
||||
// at which this weapon may spawn?
|
||||
//=========================================================
|
||||
float CFFRules::FlWeaponRespawnTime( CBaseCombatWeapon *pWeapon )
|
||||
float CFF_SH_Rules::FlWeaponRespawnTime( CBaseCombatWeapon *pWeapon )
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
if ( weaponstay.GetInt() > 0 )
|
||||
|
@ -271,7 +275,7 @@ float CFFRules::FlWeaponRespawnTime( CBaseCombatWeapon *pWeapon )
|
|||
}
|
||||
|
||||
|
||||
bool CFFRules::IsIntermission( void )
|
||||
bool CFF_SH_Rules::IsIntermission( void )
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
return m_flIntermissionEndTime > gpGlobals->curtime;
|
||||
|
@ -280,7 +284,7 @@ bool CFFRules::IsIntermission( void )
|
|||
return false;
|
||||
}
|
||||
|
||||
void CFFRules::PlayerKilled( CBasePlayer *pVictim, const CTakeDamageInfo &info )
|
||||
void CFF_SH_Rules::PlayerKilled( CBasePlayer *pVictim, const CTakeDamageInfo &info )
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
if ( IsIntermission() )
|
||||
|
@ -290,7 +294,7 @@ void CFFRules::PlayerKilled( CBasePlayer *pVictim, const CTakeDamageInfo &info )
|
|||
}
|
||||
|
||||
|
||||
void CFFRules::Think( void )
|
||||
void CFF_SH_Rules::Think( void )
|
||||
{
|
||||
|
||||
#ifndef CLIENT_DLL
|
||||
|
@ -376,7 +380,7 @@ void CFFRules::Think( void )
|
|||
#endif
|
||||
}
|
||||
|
||||
void CFFRules::GoToIntermission( void )
|
||||
void CFF_SH_Rules::GoToIntermission( void )
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
if ( g_fGameOver )
|
||||
|
@ -400,7 +404,7 @@ void CFFRules::GoToIntermission( void )
|
|||
|
||||
}
|
||||
|
||||
bool CFFRules::CheckGameOver()
|
||||
bool CFF_SH_Rules::CheckGameOver()
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
if ( g_fGameOver ) // someone else quit the game already
|
||||
|
@ -427,7 +431,7 @@ bool CFFRules::CheckGameOver()
|
|||
// now, otherwise it returns the time at which it can try
|
||||
// to spawn again.
|
||||
//=========================================================
|
||||
float CFFRules::FlWeaponTryRespawn( CBaseCombatWeapon *pWeapon )
|
||||
float CFF_SH_Rules::FlWeaponTryRespawn( CBaseCombatWeapon *pWeapon )
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
if ( pWeapon && (pWeapon->GetWeaponFlags() & ITEM_FLAG_LIMITINWORLD) )
|
||||
|
@ -446,7 +450,7 @@ float CFFRules::FlWeaponTryRespawn( CBaseCombatWeapon *pWeapon )
|
|||
// VecWeaponRespawnSpot - where should this weapon spawn?
|
||||
// Some game variations may choose to randomize spawn locations
|
||||
//=========================================================
|
||||
Vector CFFRules::VecWeaponRespawnSpot( CBaseCombatWeapon *pWeapon )
|
||||
Vector CFF_SH_Rules::VecWeaponRespawnSpot( CBaseCombatWeapon *pWeapon )
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
CWeaponHL2MPBase *pHL2Weapon = dynamic_cast< CWeaponHL2MPBase*>( pWeapon );
|
||||
|
@ -500,7 +504,7 @@ bool GetObjectsOriginalParameters( CBaseEntity *pObject, Vector &vOriginalOrigin
|
|||
return false;
|
||||
}
|
||||
|
||||
void CFFRules::ManageObjectRelocation( void )
|
||||
void CFF_SH_Rules::ManageObjectRelocation( void )
|
||||
{
|
||||
int iTotal = m_hRespawnableItemsAndWeapons.Count();
|
||||
|
||||
|
@ -555,7 +559,7 @@ void CFFRules::ManageObjectRelocation( void )
|
|||
//=========================================================
|
||||
//AddLevelDesignerPlacedWeapon
|
||||
//=========================================================
|
||||
void CFFRules::AddLevelDesignerPlacedObject( CBaseEntity *pEntity )
|
||||
void CFF_SH_Rules::AddLevelDesignerPlacedObject( CBaseEntity *pEntity )
|
||||
{
|
||||
if ( m_hRespawnableItemsAndWeapons.Find( pEntity ) == -1 )
|
||||
{
|
||||
|
@ -566,7 +570,7 @@ void CFFRules::AddLevelDesignerPlacedObject( CBaseEntity *pEntity )
|
|||
//=========================================================
|
||||
//RemoveLevelDesignerPlacedWeapon
|
||||
//=========================================================
|
||||
void CFFRules::RemoveLevelDesignerPlacedObject( CBaseEntity *pEntity )
|
||||
void CFF_SH_Rules::RemoveLevelDesignerPlacedObject( CBaseEntity *pEntity )
|
||||
{
|
||||
if ( m_hRespawnableItemsAndWeapons.Find( pEntity ) != -1 )
|
||||
{
|
||||
|
@ -578,7 +582,7 @@ void CFFRules::RemoveLevelDesignerPlacedObject( CBaseEntity *pEntity )
|
|||
// Where should this item respawn?
|
||||
// Some game variations may choose to randomize spawn locations
|
||||
//=========================================================
|
||||
Vector CFFRules::VecItemRespawnSpot( CItem *pItem )
|
||||
Vector CFF_SH_Rules::VecItemRespawnSpot( CItem *pItem )
|
||||
{
|
||||
return pItem->GetOriginalSpawnOrigin();
|
||||
}
|
||||
|
@ -586,7 +590,7 @@ Vector CFFRules::VecItemRespawnSpot( CItem *pItem )
|
|||
//=========================================================
|
||||
// What angles should this item use to respawn?
|
||||
//=========================================================
|
||||
QAngle CFFRules::VecItemRespawnAngles( CItem *pItem )
|
||||
QAngle CFF_SH_Rules::VecItemRespawnAngles( CItem *pItem )
|
||||
{
|
||||
return pItem->GetOriginalSpawnAngles();
|
||||
}
|
||||
|
@ -594,7 +598,7 @@ QAngle CFFRules::VecItemRespawnAngles( CItem *pItem )
|
|||
//=========================================================
|
||||
// At what time in the future may this Item respawn?
|
||||
//=========================================================
|
||||
float CFFRules::FlItemRespawnTime( CItem *pItem )
|
||||
float CFF_SH_Rules::FlItemRespawnTime( CItem *pItem )
|
||||
{
|
||||
return sv_hl2mp_item_respawn_time.GetFloat();
|
||||
}
|
||||
|
@ -604,7 +608,7 @@ float CFFRules::FlItemRespawnTime( CItem *pItem )
|
|||
// CanHaveWeapon - returns false if the player is not allowed
|
||||
// to pick up this weapon
|
||||
//=========================================================
|
||||
bool CFFRules::CanHavePlayerItem( CBasePlayer *pPlayer, CBaseCombatWeapon *pItem )
|
||||
bool CFF_SH_Rules::CanHavePlayerItem( CBasePlayer *pPlayer, CBaseCombatWeapon *pItem )
|
||||
{
|
||||
if ( weaponstay.GetInt() > 0 )
|
||||
{
|
||||
|
@ -621,7 +625,7 @@ bool CFFRules::CanHavePlayerItem( CBasePlayer *pPlayer, CBaseCombatWeapon *pItem
|
|||
// WeaponShouldRespawn - any conditions inhibiting the
|
||||
// respawning of this weapon?
|
||||
//=========================================================
|
||||
int CFFRules::WeaponShouldRespawn( CBaseCombatWeapon *pWeapon )
|
||||
int CFF_SH_Rules::WeaponShouldRespawn( CBaseCombatWeapon *pWeapon )
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
if ( pWeapon->HasSpawnFlags( SF_NORESPAWN ) )
|
||||
|
@ -636,7 +640,7 @@ int CFFRules::WeaponShouldRespawn( CBaseCombatWeapon *pWeapon )
|
|||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Player has just left the game
|
||||
//-----------------------------------------------------------------------------
|
||||
void CFFRules::ClientDisconnected( edict_t *pClient )
|
||||
void CFF_SH_Rules::ClientDisconnected( edict_t *pClient )
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
// Msg( "CLIENT DISCONNECTED, REMOVING FROM TEAM.\n" );
|
||||
|
@ -660,7 +664,7 @@ void CFFRules::ClientDisconnected( edict_t *pClient )
|
|||
//=========================================================
|
||||
// Deathnotice.
|
||||
//=========================================================
|
||||
void CFFRules::DeathNotice( CBasePlayer *pVictim, const CTakeDamageInfo &info )
|
||||
void CFF_SH_Rules::DeathNotice( CBasePlayer *pVictim, const CTakeDamageInfo &info )
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
// Work out what killed the player, and send a message to all clients about it
|
||||
|
@ -756,7 +760,7 @@ void CFFRules::DeathNotice( CBasePlayer *pVictim, const CTakeDamageInfo &info )
|
|||
|
||||
}
|
||||
|
||||
void CFFRules::ClientSettingsChanged( CBasePlayer *pPlayer )
|
||||
void CFF_SH_Rules::ClientSettingsChanged( CBasePlayer *pPlayer )
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
|
||||
|
@ -819,7 +823,7 @@ void CFFRules::ClientSettingsChanged( CBasePlayer *pPlayer )
|
|||
|
||||
}
|
||||
|
||||
int CFFRules::PlayerRelationship( CBaseEntity *pPlayer, CBaseEntity *pTarget )
|
||||
int CFF_SH_Rules::PlayerRelationship( CBaseEntity *pPlayer, CBaseEntity *pTarget )
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
// half life multiplay has a simple concept of Player Relationships.
|
||||
|
@ -836,7 +840,7 @@ int CFFRules::PlayerRelationship( CBaseEntity *pPlayer, CBaseEntity *pTarget )
|
|||
return GR_NOTTEAMMATE;
|
||||
}
|
||||
|
||||
const char *CFFRules::GetGameDescription( void )
|
||||
const char *CFF_SH_Rules::GetGameDescription( void )
|
||||
{
|
||||
if ( IsTeamplay() )
|
||||
return "Team Deathmatch";
|
||||
|
@ -844,12 +848,12 @@ const char *CFFRules::GetGameDescription( void )
|
|||
return "Deathmatch";
|
||||
}
|
||||
|
||||
bool CFFRules::IsConnectedUserInfoChangeAllowed( CBasePlayer *pPlayer )
|
||||
bool CFF_SH_Rules::IsConnectedUserInfoChangeAllowed( CBasePlayer *pPlayer )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
float CFFRules::GetMapRemainingTime()
|
||||
float CFF_SH_Rules::GetMapRemainingTime()
|
||||
{
|
||||
// if timelimit is disabled, return 0
|
||||
if ( mp_timelimit.GetInt() <= 0 )
|
||||
|
@ -865,12 +869,12 @@ float CFFRules::GetMapRemainingTime()
|
|||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void CFFRules::Precache( void )
|
||||
void CFF_SH_Rules::Precache( void )
|
||||
{
|
||||
CBaseEntity::PrecacheScriptSound( "AlyxEmp.Charge" );
|
||||
}
|
||||
|
||||
bool CFFRules::ShouldCollide( int collisionGroup0, int collisionGroup1 )
|
||||
bool CFF_SH_Rules::ShouldCollide( int collisionGroup0, int collisionGroup1 )
|
||||
{
|
||||
if ( collisionGroup0 > collisionGroup1 )
|
||||
{
|
||||
|
@ -888,7 +892,7 @@ bool CFFRules::ShouldCollide( int collisionGroup0, int collisionGroup1 )
|
|||
|
||||
}
|
||||
|
||||
bool CFFRules::ClientCommand( CBaseEntity *pEdict, const CCommand &args )
|
||||
bool CFF_SH_Rules::ClientCommand( CBaseEntity *pEdict, const CCommand &args )
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
if( BaseClass::ClientCommand( pEdict, args ) )
|
||||
|
@ -976,7 +980,7 @@ CAmmoDef *GetAmmoDef()
|
|||
|
||||
#endif
|
||||
|
||||
bool CFFRules::FShouldSwitchWeapon( CBasePlayer *pPlayer, CBaseCombatWeapon *pWeapon )
|
||||
bool CFF_SH_Rules::FShouldSwitchWeapon( CBasePlayer *pPlayer, CBaseCombatWeapon *pWeapon )
|
||||
{
|
||||
if ( pPlayer->GetActiveWeapon() && pPlayer->IsNetClient() )
|
||||
{
|
||||
|
@ -995,7 +999,7 @@ CAmmoDef *GetAmmoDef()
|
|||
|
||||
#ifndef CLIENT_DLL
|
||||
|
||||
void CFFRules::RestartGame()
|
||||
void CFF_SH_Rules::RestartGame()
|
||||
{
|
||||
// bounds check
|
||||
if ( mp_timelimit.GetInt() < 0 )
|
||||
|
@ -1059,7 +1063,7 @@ void CFFRules::RestartGame()
|
|||
}
|
||||
}
|
||||
|
||||
void CFFRules::CleanUpMap()
|
||||
void CFF_SH_Rules::CleanUpMap()
|
||||
{
|
||||
// Recreate all the map entities from the map data (preserving their indices),
|
||||
// then remove everything else except the players.
|
||||
|
@ -1156,7 +1160,7 @@ void CFFRules::CleanUpMap()
|
|||
MapEntity_ParseAllEntities( engine->GetMapEntitiesString(), &filter, true );
|
||||
}
|
||||
|
||||
void CFFRules::CheckChatForReadySignal( CHL2MP_Player *pPlayer, const char *chatmsg )
|
||||
void CFF_SH_Rules::CheckChatForReadySignal( CHL2MP_Player *pPlayer, const char *chatmsg )
|
||||
{
|
||||
if( m_bAwaitingReadyRestart && FStrEq( chatmsg, mp_ready_signal.GetString() ) )
|
||||
{
|
||||
|
@ -1167,7 +1171,7 @@ void CFFRules::CheckChatForReadySignal( CHL2MP_Player *pPlayer, const char *chat
|
|||
}
|
||||
}
|
||||
|
||||
void CFFRules::CheckRestartGame( void )
|
||||
void CFF_SH_Rules::CheckRestartGame( void )
|
||||
{
|
||||
// Restart the game if specified by the server
|
||||
int iRestartDelay = mp_restartgame.GetInt();
|
||||
|
@ -1215,7 +1219,7 @@ void CFFRules::CheckRestartGame( void )
|
|||
}
|
||||
}
|
||||
|
||||
void CFFRules::CheckAllPlayersReady( void )
|
||||
void CFF_SH_Rules::CheckAllPlayersReady( void )
|
||||
{
|
||||
for (int i = 1; i <= gpGlobals->maxClients; i++ )
|
||||
{
|
||||
|
@ -1232,7 +1236,7 @@ void CFFRules::CheckAllPlayersReady( void )
|
|||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
const char *CFFRules::GetChatFormat( bool bTeamOnly, CBasePlayer *pPlayer )
|
||||
const char *CFF_SH_Rules::GetChatFormat( bool bTeamOnly, CBasePlayer *pPlayer )
|
||||
{
|
||||
if ( !pPlayer ) // dedicated server output
|
||||
{
|
|
@ -11,8 +11,8 @@
|
|||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef FF_GAMERULES_H
|
||||
#define FF_GAMERULES_H
|
||||
#ifndef FF_SH_GAMERULES_H
|
||||
#define FF_SH_GAMERULES_H
|
||||
#pragma once
|
||||
|
||||
#include "gamerules.h"
|
||||
|
@ -34,14 +34,17 @@ enum
|
|||
|
||||
|
||||
#ifdef CLIENT_DLL
|
||||
#define CFFRules C_FFRules
|
||||
#define CFFGameRulesProxy C_FFGameRulesProxy
|
||||
#define CFF_SH_Rules CFF_CL_Rules
|
||||
#define CFF_SH_GameRulesProxy CFF_CL_GameRulesProxy
|
||||
#else
|
||||
#define CFF_SH_Rules CFF_SV_Rules
|
||||
#define CFF_SH_GameRulesProxy CFF_SV_GameRulesProxy
|
||||
#endif
|
||||
|
||||
class CFFGameRulesProxy : public CGameRulesProxy
|
||||
class CFF_SH_GameRulesProxy : public CGameRulesProxy
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS( CFFGameRulesProxy, CGameRulesProxy );
|
||||
DECLARE_CLASS( CFF_SH_GameRulesProxy, CGameRulesProxy );
|
||||
DECLARE_NETWORKCLASS();
|
||||
};
|
||||
|
||||
|
@ -79,10 +82,10 @@ public:
|
|||
Vector m_vCrouchTraceMax;
|
||||
};
|
||||
|
||||
class CFFRules : public CTeamplayRules
|
||||
class CFF_SH_Rules : public CTeamplayRules
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS( CFFRules, CTeamplayRules );
|
||||
DECLARE_CLASS( CFF_SH_Rules, CTeamplayRules );
|
||||
|
||||
#ifdef CLIENT_DLL
|
||||
|
||||
|
@ -93,8 +96,8 @@ public:
|
|||
DECLARE_SERVERCLASS_NOBASE(); // This makes datatables able to access our private vars.
|
||||
#endif
|
||||
|
||||
CFFRules();
|
||||
virtual ~CFFRules();
|
||||
CFF_SH_Rules();
|
||||
virtual ~CFF_SH_Rules();
|
||||
|
||||
virtual void Precache( void );
|
||||
virtual bool ShouldCollide( int collisionGroup0, int collisionGroup1 );
|
||||
|
@ -164,9 +167,9 @@ private:
|
|||
#endif
|
||||
};
|
||||
|
||||
inline CFFRules* FFRules()
|
||||
inline CFF_SH_Rules* FFRules()
|
||||
{
|
||||
return static_cast<CFFRules*>(g_pGameRules);
|
||||
return static_cast<CFF_SH_Rules*>(g_pGameRules);
|
||||
}
|
||||
|
||||
#endif //HL2MP_GAMERULES_H
|
||||
#endif //FF_SH_GAMERULES_H
|
|
@ -2,7 +2,7 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// includes
|
||||
#include "cbase.h"
|
||||
#include "ff_scriptman_shared.h"
|
||||
#include "ff_sh_scriptman.h"
|
||||
//#include "ff_entity_system.h"
|
||||
//#include "ff_luacontext.h"
|
||||
//#include "ff_lualib.h"
|
||||
|
@ -39,11 +39,11 @@ using namespace luabind;
|
|||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// globals
|
||||
CFFScriptManager _scriptman;
|
||||
CFF_SH_ScriptManager _scriptman;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
CFFScriptManager::CFFScriptManager()
|
||||
CFF_SH_ScriptManager::CFF_SH_ScriptManager()
|
||||
: L(NULL)
|
||||
, m_isLoading(false)
|
||||
, m_scriptCRC(0)
|
||||
|
@ -52,14 +52,14 @@ CFFScriptManager::CFFScriptManager()
|
|||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
CFFScriptManager::~CFFScriptManager()
|
||||
CFF_SH_ScriptManager::~CFF_SH_ScriptManager()
|
||||
{
|
||||
Shutdown();
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
void CFFScriptManager::Shutdown()
|
||||
void CFF_SH_ScriptManager::Shutdown()
|
||||
{
|
||||
m_ScriptExists = false;
|
||||
|
||||
|
@ -73,7 +73,7 @@ void CFFScriptManager::Shutdown()
|
|||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
void CFFScriptManager::Init()
|
||||
void CFF_SH_ScriptManager::Init()
|
||||
{
|
||||
// shutdown VM if already running
|
||||
if(L)
|
||||
|
@ -109,10 +109,10 @@ void CFFScriptManager::Init()
|
|||
}
|
||||
|
||||
#ifdef FF_DLL
|
||||
void CFFScriptManager::LevelInit(const char* szMapName)
|
||||
void CFF_SH_ScriptManager::LevelInit(const char* szMapName)
|
||||
{
|
||||
const char* default_luafile = "maps/default.lua";
|
||||
//FF_TODO: VPROF_BUDGET("CFFScriptManager::LevelInit", VPROF_BUDGETGROUP_FF_LUA);
|
||||
//FF_TODO: VPROF_BUDGET("CFF_SH_ScriptManager::LevelInit", VPROF_BUDGETGROUP_FF_LUA);
|
||||
|
||||
if(!szMapName)
|
||||
return;
|
||||
|
@ -235,7 +235,7 @@ void CFFScriptManager::LevelInit(const char* szMapName)
|
|||
|
||||
#ifdef FF_DLL
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
void CFFScriptManager::LevelShutdown()
|
||||
void CFF_SH_ScriptManager::LevelShutdown()
|
||||
{
|
||||
// shutdown the VM
|
||||
if(L)
|
||||
|
@ -248,7 +248,7 @@ void CFFScriptManager::LevelShutdown()
|
|||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
void CFFScriptManager::OnScriptLoad(const char* szFileName,
|
||||
void CFF_SH_ScriptManager::OnScriptLoad(const char* szFileName,
|
||||
const char* szFileContents)
|
||||
{
|
||||
// ignore the message if we are not still in the "loading" phase
|
||||
|
@ -262,14 +262,14 @@ void CFFScriptManager::OnScriptLoad(const char* szFileName,
|
|||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
void CFFScriptManager::BeginScriptLoad()
|
||||
void CFF_SH_ScriptManager::BeginScriptLoad()
|
||||
{
|
||||
CRC32_Init(&m_scriptCRC);
|
||||
m_isLoading = true;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
void CFFScriptManager::EndScriptLoad()
|
||||
void CFF_SH_ScriptManager::EndScriptLoad()
|
||||
{
|
||||
CRC32_Final(&m_scriptCRC);
|
||||
m_isLoading = false;
|
||||
|
@ -277,9 +277,9 @@ void CFFScriptManager::EndScriptLoad()
|
|||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
bool CFFScriptManager::LoadFile( lua_State *L, const char *filename)
|
||||
bool CFF_SH_ScriptManager::LoadFile( lua_State *L, const char *filename)
|
||||
{
|
||||
//FF_TODO: VPROF_BUDGET( "CFFScriptManager::LoadFile", VPROF_BUDGETGROUP_FF_LUA );
|
||||
//FF_TODO: VPROF_BUDGET( "CFF_SH_ScriptManager::LoadFile", VPROF_BUDGETGROUP_FF_LUA );
|
||||
|
||||
// don't allow scripters to sneak in scripts after the initial load
|
||||
if(!_scriptman.m_isLoading)
|
|
@ -1,113 +1,113 @@
|
|||
|
||||
// ff_scriptman.h
|
||||
|
||||
#ifndef FF_SCRIPTMAN_H
|
||||
#define FF_SCRIPTMAN_H
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// includes
|
||||
#ifndef CHECKSUM_CRC_H
|
||||
#include "checksum_crc.h"
|
||||
#endif
|
||||
|
||||
#define PRECACHE_LUA_FILES 1
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// forward declarations
|
||||
struct lua_State;
|
||||
|
||||
namespace luabind
|
||||
{
|
||||
namespace adl
|
||||
{
|
||||
class object;
|
||||
}
|
||||
}
|
||||
|
||||
class CFFLuaSC;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
class CFFScriptManager
|
||||
{
|
||||
public:
|
||||
// 'structors
|
||||
CFFScriptManager();
|
||||
~CFFScriptManager();
|
||||
|
||||
public:
|
||||
// inserts the lua file into the script environment
|
||||
static bool LoadFile(lua_State*, const char* filePath);
|
||||
|
||||
public:
|
||||
// loads the scripts for the level
|
||||
void LevelInit(const char* szMapName);
|
||||
|
||||
// cleans up the scripts for the most recent level
|
||||
void LevelShutdown();
|
||||
|
||||
private:
|
||||
// initializes the script VM
|
||||
void Init();
|
||||
void Shutdown();
|
||||
|
||||
// surround code that loads scripts to capture crc checksum
|
||||
// of the scripts that are loaded
|
||||
void BeginScriptLoad();
|
||||
void EndScriptLoad();
|
||||
|
||||
private:
|
||||
// called when a script is loaded. internally computes the
|
||||
// crc checksum of the file contents
|
||||
void OnScriptLoad(const char* szFileName, const char* szFileContents);
|
||||
|
||||
public:
|
||||
// sets a global variable in the script environment
|
||||
static void SetVar( lua_State *L, const char *name, const char *value );
|
||||
static void SetVar( lua_State *L, const char *name, int value );
|
||||
static void SetVar( lua_State *L, const char *name, float value );
|
||||
void SetVar(const char* name, const char* value);
|
||||
void SetVar(const char* name, int value);
|
||||
void SetVar(const char* name, float value);
|
||||
|
||||
// gets a global variable from the script environment
|
||||
const char* GetString(const char* name);
|
||||
int GetInt(const char* name);
|
||||
float GetFloat(const char* name);
|
||||
|
||||
bool GetObject(CBaseEntity* pEntity, luabind::adl::object& outObject);
|
||||
bool GetObject(const char* szTableName, luabind::adl::object& outObject);
|
||||
|
||||
bool GetFunction(CBaseEntity* pEntity,
|
||||
const char* szFunctionName,
|
||||
luabind::adl::object& outObject);
|
||||
|
||||
bool GetFunction(luabind::adl::object& tableObject,
|
||||
const char* szFunctionName,
|
||||
luabind::adl::object& outObject);
|
||||
|
||||
public:
|
||||
int RunPredicates( CBaseEntity *pObject, CBaseEntity *pEntity, const char *szFunctionName = NULL);
|
||||
bool RunPredicates_LUA( CBaseEntity *pObject, CFFLuaSC *pContext, const char *szFunctionName );
|
||||
|
||||
public:
|
||||
// returns the lua interpreter
|
||||
lua_State* GetLuaState() const { return L; }
|
||||
bool ScriptExists( void ) const { return m_ScriptExists; }
|
||||
|
||||
// returns the crc checksum of the currently active script
|
||||
CRC32_t GetScriptCRC() const { return m_scriptCRC; }
|
||||
|
||||
private:
|
||||
// private data
|
||||
lua_State* L; // lua VM
|
||||
bool m_ScriptExists;
|
||||
bool m_isLoading;
|
||||
CRC32_t m_scriptCRC;
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// global externs
|
||||
extern CFFScriptManager _scriptman;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif
|
||||
|
||||
// ff_sh_scriptman.h
|
||||
|
||||
#ifndef FF_SH_SCRIPTMAN_H
|
||||
#define FF_SH_SCRIPTMAN_H
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// includes
|
||||
#ifndef CHECKSUM_CRC_H
|
||||
#include "checksum_crc.h"
|
||||
#endif
|
||||
|
||||
#define PRECACHE_LUA_FILES 1
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// forward declarations
|
||||
struct lua_State;
|
||||
|
||||
namespace luabind
|
||||
{
|
||||
namespace adl
|
||||
{
|
||||
class object;
|
||||
}
|
||||
}
|
||||
|
||||
class CFFLuaSC;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
class CFF_SH_ScriptManager
|
||||
{
|
||||
public:
|
||||
// 'structors
|
||||
CFF_SH_ScriptManager();
|
||||
~CFF_SH_ScriptManager();
|
||||
|
||||
public:
|
||||
// inserts the lua file into the script environment
|
||||
static bool LoadFile(lua_State*, const char* filePath);
|
||||
|
||||
public:
|
||||
// loads the scripts for the level
|
||||
void LevelInit(const char* szMapName);
|
||||
|
||||
// cleans up the scripts for the most recent level
|
||||
void LevelShutdown();
|
||||
|
||||
private:
|
||||
// initializes the script VM
|
||||
void Init();
|
||||
void Shutdown();
|
||||
|
||||
// surround code that loads scripts to capture crc checksum
|
||||
// of the scripts that are loaded
|
||||
void BeginScriptLoad();
|
||||
void EndScriptLoad();
|
||||
|
||||
private:
|
||||
// called when a script is loaded. internally computes the
|
||||
// crc checksum of the file contents
|
||||
void OnScriptLoad(const char* szFileName, const char* szFileContents);
|
||||
|
||||
public:
|
||||
// sets a global variable in the script environment
|
||||
static void SetVar( lua_State *L, const char *name, const char *value );
|
||||
static void SetVar( lua_State *L, const char *name, int value );
|
||||
static void SetVar( lua_State *L, const char *name, float value );
|
||||
void SetVar(const char* name, const char* value);
|
||||
void SetVar(const char* name, int value);
|
||||
void SetVar(const char* name, float value);
|
||||
|
||||
// gets a global variable from the script environment
|
||||
const char* GetString(const char* name);
|
||||
int GetInt(const char* name);
|
||||
float GetFloat(const char* name);
|
||||
|
||||
bool GetObject(CBaseEntity* pEntity, luabind::adl::object& outObject);
|
||||
bool GetObject(const char* szTableName, luabind::adl::object& outObject);
|
||||
|
||||
bool GetFunction(CBaseEntity* pEntity,
|
||||
const char* szFunctionName,
|
||||
luabind::adl::object& outObject);
|
||||
|
||||
bool GetFunction(luabind::adl::object& tableObject,
|
||||
const char* szFunctionName,
|
||||
luabind::adl::object& outObject);
|
||||
|
||||
public:
|
||||
int RunPredicates( CBaseEntity *pObject, CBaseEntity *pEntity, const char *szFunctionName = NULL);
|
||||
bool RunPredicates_LUA( CBaseEntity *pObject, CFFLuaSC *pContext, const char *szFunctionName );
|
||||
|
||||
public:
|
||||
// returns the lua interpreter
|
||||
lua_State* GetLuaState() const { return L; }
|
||||
bool ScriptExists( void ) const { return m_ScriptExists; }
|
||||
|
||||
// returns the crc checksum of the currently active script
|
||||
CRC32_t GetScriptCRC() const { return m_scriptCRC; }
|
||||
|
||||
private:
|
||||
// private data
|
||||
lua_State* L; // lua VM
|
||||
bool m_ScriptExists;
|
||||
bool m_isLoading;
|
||||
CRC32_t m_scriptCRC;
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// global externs
|
||||
extern CFF_SH_ScriptManager _scriptman;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif
|
|
@ -5,12 +5,12 @@ $Project
|
|||
{
|
||||
$Folder "Source Files"
|
||||
{
|
||||
$Folder "FF Shared"
|
||||
$Folder "FF"
|
||||
{
|
||||
$Folder "Lua"
|
||||
{
|
||||
$File "$SRCDIR\game\shared\ff\ff_scriptman_shared.cpp"
|
||||
$File "$SRCDIR\game\shared\ff\ff_scriptman_shared.h"
|
||||
$File "$SRCDIR\game\shared\ff\ff_sh_scriptman.cpp"
|
||||
$File "$SRCDIR\game\shared\ff\ff_sh_scriptman.h"
|
||||
}
|
||||
$Folder "Movement"
|
||||
{
|
||||
|
@ -18,8 +18,8 @@ $Project
|
|||
$File "$SRCDIR\game\shared\ff\ff_sh_gamemovement.h"
|
||||
}
|
||||
|
||||
$File "$SRCDIR\game\shared\ff\ff_gamerules_shared.cpp"
|
||||
$File "$SRCDIR\game\shared\ff\ff_gamerules_shared.h"
|
||||
$File "$SRCDIR\game\shared\ff\ff_sh_gamerules.cpp"
|
||||
$File "$SRCDIR\game\shared\ff\ff_sh_gamerules.h"
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "in_buttons.h"
|
||||
#include "takedamageinfo.h"
|
||||
#include "ammodef.h"
|
||||
#include "ff_gamerules_shared.h"
|
||||
#include "ff_sh_gamerules.h"
|
||||
|
||||
|
||||
#ifdef CLIENT_DLL
|
||||
|
|
Loading…
Reference in a new issue