Semi-working mount code.

Still buggy and crash prone but better than it was in past commits.
This commit is contained in:
whoozzem 2013-09-19 17:52:31 +01:00
parent 7de474d068
commit caba619100
4 changed files with 75 additions and 77 deletions

View file

@ -1646,8 +1646,12 @@ void CHLClient::LevelInitPreEntity( char const* pMapName )
if (sv_hl2_mount.GetBool())
{
filesystem->RemoveAllSearchPaths(); // We have to remove all search paths or the game gets confused about model vertex counts etc.
filesystem->AddSearchPath("orangebox", "EXECUTABLE_PATH");
filesystem->AddSearchPath("orangebox", "PLATFORM");
filesystem->AddSearchPath("ep2", "EXECUTABLE_PATH");
filesystem->AddSearchPath("ep2", "PLATFORM");
//filesystem->AddSearchPath("../../../steamapps/common/Half-Life 2/ep2/bin" //Exe Path
//filesystem->AddSearchPath("../../../steamapps/common/Half-Life 2/ep2" //Platform Path
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "MOD");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp/bin", "GAMEBIN");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "GAME");
@ -1670,8 +1674,8 @@ void CHLClient::LevelInitPreEntity( char const* pMapName )
if (sv_ep1_mount.GetBool())
{
filesystem->RemoveAllSearchPaths(); // We have to remove all search paths or the game gets confused about model vertex counts etc.
filesystem->AddSearchPath("orangebox", "EXECUTABLE_PATH");
filesystem->AddSearchPath("orangebox", "PLATFORM");
filesystem->AddSearchPath("ep2", "EXECUTABLE_PATH");
filesystem->AddSearchPath("ep2", "PLATFORM");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "MOD");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp/bin", "GAMEBIN");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "GAME");
@ -1696,8 +1700,8 @@ void CHLClient::LevelInitPreEntity( char const* pMapName )
if (sv_ep2_mount.GetBool())
{
filesystem->RemoveAllSearchPaths(); // We have to remove all search paths or the game gets confused about model vertex counts etc.
filesystem->AddSearchPath("orangebox", "EXECUTABLE_PATH");
filesystem->AddSearchPath("orangebox", "PLATFORM");
filesystem->AddSearchPath("ep2", "EXECUTABLE_PATH");
filesystem->AddSearchPath("ep2", "PLATFORM");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "MOD");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp/bin", "GAMEBIN");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "GAME");
@ -1724,8 +1728,8 @@ void CHLClient::LevelInitPreEntity( char const* pMapName )
{
filesystem->RemoveAllSearchPaths(); // We have to remove all search paths or the game gets confused about model vertex counts etc.
Msg("WARNING ! FAIL-SAFE CONTENT IS BEING MOUNTED! MAP NAME NOT VALID FOR DYNAMIC GCF MOUNTING! FIX THIS OR CHANGE TO A DIFFERENT LEVEL ! \n");
filesystem->AddSearchPath("orangebox", "EXECUTABLE_PATH");
filesystem->AddSearchPath("orangebox", "PLATFORM");
filesystem->AddSearchPath("ep2", "EXECUTABLE_PATH");
filesystem->AddSearchPath("ep2", "PLATFORM");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "MOD");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp/bin", "GAMEBIN");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "GAME");

View file

@ -1059,32 +1059,32 @@ bool CServerGameDLL::LevelInit( const char *pMapName, char const *pMapEntities,
Msg("HALFLIFE 2 CONTENT IS BEING MOUNTED! \n");
filesystem->RemoveAllSearchPaths(); // We have to remove all search paths or the game gets confused about model vertex counts etc.
//4WH - Information: Dedicated servers require different search paths to work.
filesystem->AddSearchPath("../orangebox", "EXECUTABLE_PATH");
filesystem->AddSearchPath("../orangebox", "PLATFORM");
//filesystem->AddSearchPath("../orangebox", "EXECUTABLE_PATH");
//filesystem->AddSearchPath("../orangebox", "PLATFORM");
if (sv_dedicated.GetBool())
{
filesystem->AddSearchPath("mod_hl2mp", "MOD");
filesystem->AddSearchPath("mod_hl2mp/bin", "GAMEBIN");
filesystem->AddSearchPath("mod_hl2mp", "GAME");
filesystem->AddSearchPath("mod_hl2mp", "MOD");
filesystem->AddSearchPath("mod_hl2mp/bin", "GAMEBIN");
filesystem->AddSearchPath("mod_hl2mp", "GAME");
}
else
{
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "MOD");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp/bin", "GAMEBIN");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "GAME");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "MOD");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp/bin", "GAMEBIN");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "GAME");
}
filesystem->AddSearchPath("hl2", "GAMEBIN");
filesystem->AddSearchPath("hl2", "GAME", PATH_ADD_TO_TAIL); //Add to the Tail
filesystem->MountSteamContent(-220); //Half-Life 2
if (sv_dedicated.GetBool())
{
filesystem->AddSearchPath("mod_hl2mp", "DEFAULT_WRITE_PATH");
filesystem->AddSearchPath("mod_hl2mp", "LOGDIR");
filesystem->AddSearchPath("mod_hl2mp", "DEFAULT_WRITE_PATH");
filesystem->AddSearchPath("mod_hl2mp", "LOGDIR");
}
else
{
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "DEFAULT_WRITE_PATH");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "LOGDIR");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "DEFAULT_WRITE_PATH");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "LOGDIR");
}
filesystem->AddSearchPath("hl2mp", "GAME");
filesystem->MountSteamContent(-320); //Half-Life 2:Deathmatch
@ -1109,19 +1109,19 @@ bool CServerGameDLL::LevelInit( const char *pMapName, char const *pMapEntities,
filesystem->RemoveAllSearchPaths(); // We have to remove all search paths or the game gets confused about model vertex counts etc.
//4WH - Information: Dedicated servers require different search paths to work.
filesystem->AddSearchPath("../orangebox", "EXECUTABLE_PATH");
filesystem->AddSearchPath("../orangebox", "PLATFORM");
filesystem->AddSearchPath("../ep2", "EXECUTABLE_PATH");
filesystem->AddSearchPath("../ep2", "PLATFORM");
if (sv_dedicated.GetBool())
{
filesystem->AddSearchPath("mod_hl2mp", "MOD");
filesystem->AddSearchPath("mod_hl2mp/bin", "GAMEBIN");
filesystem->AddSearchPath("mod_hl2mp", "GAME");
filesystem->AddSearchPath("mod_hl2mp", "MOD");
filesystem->AddSearchPath("mod_hl2mp/bin", "GAMEBIN");
filesystem->AddSearchPath("mod_hl2mp", "GAME");
}
else
{
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "MOD");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp/bin", "GAMEBIN");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "GAME");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "MOD");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp/bin", "GAMEBIN");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "GAME");
}
filesystem->AddSearchPath("episodic", "GAMEBIN");
filesystem->AddSearchPath("episodic", "GAME", PATH_ADD_TO_TAIL); //Add to the Tail
@ -1131,13 +1131,13 @@ bool CServerGameDLL::LevelInit( const char *pMapName, char const *pMapEntities,
filesystem->MountSteamContent(-220); //Half-Life 2
if (sv_dedicated.GetBool())
{
filesystem->AddSearchPath("mod_hl2mp", "DEFAULT_WRITE_PATH");
filesystem->AddSearchPath("mod_hl2mp", "LOGDIR");
filesystem->AddSearchPath("mod_hl2mp", "DEFAULT_WRITE_PATH");
filesystem->AddSearchPath("mod_hl2mp", "LOGDIR");
}
else
{
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "DEFAULT_WRITE_PATH");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "LOGDIR");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "DEFAULT_WRITE_PATH");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "LOGDIR");
}
filesystem->AddSearchPath("hl2mp", "GAME");
filesystem->MountSteamContent(-320); //Half-Life 2:Deathmatch
@ -1160,19 +1160,19 @@ bool CServerGameDLL::LevelInit( const char *pMapName, char const *pMapEntities,
Msg("EPISODE 2 CONTENT IS BEING MOUNTED! \n");
filesystem->RemoveAllSearchPaths(); // We have to remove all search paths or the game gets confused about model vertex counts etc.
//4WH - Information: Dedicated servers require different search paths to work.
filesystem->AddSearchPath("../orangebox", "EXECUTABLE_PATH");
filesystem->AddSearchPath("../orangebox", "PLATFORM");
filesystem->AddSearchPath("../ep2", "EXECUTABLE_PATH");
filesystem->AddSearchPath("../ep2", "PLATFORM");
if (sv_dedicated.GetBool())
{
filesystem->AddSearchPath("mod_hl2mp", "MOD");
filesystem->AddSearchPath("mod_hl2mp/bin", "GAMEBIN");
filesystem->AddSearchPath("mod_hl2mp", "GAME");
filesystem->AddSearchPath("mod_hl2mp", "MOD");
filesystem->AddSearchPath("mod_hl2mp/bin", "GAMEBIN");
filesystem->AddSearchPath("mod_hl2mp", "GAME");
}
else
{
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "MOD");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp/bin", "GAMEBIN");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "GAME");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "MOD");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp/bin", "GAMEBIN");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "GAME");
}
filesystem->AddSearchPath("ep2", "GAMEBIN");
filesystem->AddSearchPath("ep2", "GAME", PATH_ADD_TO_TAIL); //Add to the Tail
@ -1182,13 +1182,13 @@ bool CServerGameDLL::LevelInit( const char *pMapName, char const *pMapEntities,
filesystem->MountSteamContent(-220); //Half-Life 2
if (sv_dedicated.GetBool())
{
filesystem->AddSearchPath("mod_hl2mp", "DEFAULT_WRITE_PATH");
filesystem->AddSearchPath("mod_hl2mp", "LOGDIR");
filesystem->AddSearchPath("mod_hl2mp", "DEFAULT_WRITE_PATH");
filesystem->AddSearchPath("mod_hl2mp", "LOGDIR");
}
else
{
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "DEFAULT_WRITE_PATH");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "LOGDIR");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "DEFAULT_WRITE_PATH");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "LOGDIR");
}
filesystem->AddSearchPath("hl2mp", "GAME");
filesystem->MountSteamContent(-320); //Half-Life 2:Deathmatch
@ -1210,31 +1210,31 @@ bool CServerGameDLL::LevelInit( const char *pMapName, char const *pMapEntities,
{
Msg("WARNING ! FAIL-SAFE CONTENT IS BEING MOUNTED! MAP NAME NOT VALID FOR DYNAMIC GCF MOUNTING! FIX THIS OR CHANGE TO A DIFFERENT LEVEL ! \n");
filesystem->RemoveAllSearchPaths(); // We have to remove all search paths or the game gets confused about model vertex counts etc.
filesystem->AddSearchPath("../orangebox", "EXECUTABLE_PATH");
filesystem->AddSearchPath("../orangebox", "PLATFORM");
filesystem->AddSearchPath("../ep2", "EXECUTABLE_PATH");
filesystem->AddSearchPath("../ep2", "PLATFORM");
if (sv_dedicated.GetBool())
{
filesystem->AddSearchPath("mod_hl2mp", "MOD");
filesystem->AddSearchPath("mod_hl2mp/bin", "GAMEBIN");
filesystem->AddSearchPath("mod_hl2mp", "GAME");
filesystem->AddSearchPath("mod_hl2mp", "MOD");
filesystem->AddSearchPath("mod_hl2mp/bin", "GAMEBIN");
filesystem->AddSearchPath("mod_hl2mp", "GAME");
}
else
{
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "MOD");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp/bin", "GAMEBIN");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "GAME");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "MOD");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp/bin", "GAMEBIN");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "GAME");
}
filesystem->AddSearchPath("hl2mp", "GAME");
filesystem->MountSteamContent(-320); //Half-Life 2:Deathmatch
if (sv_dedicated.GetBool())
{
filesystem->AddSearchPath("mod_hl2mp", "DEFAULT_WRITE_PATH");
filesystem->AddSearchPath("mod_hl2mp", "LOGDIR");
filesystem->AddSearchPath("mod_hl2mp", "DEFAULT_WRITE_PATH");
filesystem->AddSearchPath("mod_hl2mp", "LOGDIR");
}
else
{
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "DEFAULT_WRITE_PATH");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "LOGDIR");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "DEFAULT_WRITE_PATH");
filesystem->AddSearchPath("../../../steamapps/SourceMods/mod_hl2mp", "LOGDIR");
}
sv_hl2_mount.SetValue(0);
sv_ep1_mount.SetValue(0);

View file

@ -2545,11 +2545,23 @@ ConVar sv_alternateticks( "sv_alternateticks", ( IsX360() ) ? "1" : "0", FCVAR_S
//-----------------------------------------------------------------------------
bool CBaseEntity::IsSimulatingOnAlternateTicks()
{
//.Kave's fix for slow motion single player problems.
#ifdef seco7_ENABLED_FIXED_MULTIPLAYER_AI
if( gpGlobals->maxClients > 1 )
{
sv_alternateticks.SetValue( 1 );
}
else if( gpGlobals->maxClients == 1 )
{
sv_alternateticks.SetValue( 0 );
}
#else
if ( gpGlobals->maxClients != 1 )
{
return false;
}
#endif
return sv_alternateticks.GetBool();
}

View file

@ -1,5 +1,5 @@
//====================================================//
// Source Engine CoOperative v7. //
// Source Engine CoOperative. //
//====================================================//
#ifndef seco7_SHAREDDEFS_H
#define seco7_SHAREDDEFS_H
@ -7,25 +7,7 @@
#pragma once
#endif
//-----------------------------------------------//
// Additional Searches/Information for coders. //
//-------------------------------------------//
//4WH - Mounting Code:
//4WH - Compile Issues:
//4WH - Episodic Issues:
//4WH - Null Pointers:
//4WH - Information:
//4WH - Portal Information:
//4WH - CodeAddendumms: (these are addendums provided by others on the Valve wiki page).
//
// To those wishing to make a co-op version of the Half-Life 2/Ep1/2 maps, Mulekick on the steam forums gave this advice for older maps:
// - This does mean that you will need to start using the Everything solution file, which means more work settings things up again -
//Basically brushes that block LOS from AI's won't work with older maps.
//To fix this:
//In public/bspflags.h, change the line starting with
//#define MASK_BLOCKLOS (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_BLOCKLOS)
//to:
//#define MASK_BLOCKLOS (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_BLOCKLOS|CONTENTS_OPAQUE)
//Besides the Valve Wiki page, further information and help can be found in the shared/seco/seco_information.h file.
/*****************/
/* Base Defines. */