mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-01-12 23:07:55 +03:00
Added custom gameinfo.txt values for HL2 default player model + enabling external drawing by default
This commit is contained in:
parent
cea38f03ec
commit
483abff3b3
@ -1476,6 +1476,9 @@ CStudioHdr *CHL2_Player::OnNewModel()
|
||||
|
||||
return hdr;
|
||||
}
|
||||
|
||||
extern char g_szDefaultPlayerModel[MAX_PATH];
|
||||
extern bool g_bDefaultPlayerDrawExternally;
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -1486,8 +1489,13 @@ void CHL2_Player::Spawn(void)
|
||||
|
||||
#ifndef HL2MP
|
||||
#ifndef PORTAL
|
||||
#ifdef MAPBASE
|
||||
if ( GetModelName() == NULL_STRING )
|
||||
SetModel( g_szDefaultPlayerModel );
|
||||
#else
|
||||
SetModel( "models/player.mdl" );
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
BaseClass::Spawn();
|
||||
@ -1501,6 +1509,8 @@ void CHL2_Player::Spawn(void)
|
||||
|
||||
RemoveEffects( EF_NODRAW );
|
||||
}
|
||||
|
||||
SetDrawPlayerModelExternally( g_bDefaultPlayerDrawExternally );
|
||||
#endif
|
||||
|
||||
//
|
||||
|
@ -82,6 +82,12 @@ static bool g_bMapbaseCore;
|
||||
// The game's name found in gameinfo.txt. Mostly used for Discord RPC.
|
||||
char g_iszGameName[128];
|
||||
|
||||
#ifdef GAME_DLL
|
||||
// Default player configuration
|
||||
char g_szDefaultPlayerModel[MAX_PATH];
|
||||
bool g_bDefaultPlayerDrawExternally;
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
MANIFEST_SOUNDSCRIPTS,
|
||||
@ -216,6 +222,11 @@ public:
|
||||
|
||||
Q_strncpy(g_iszGameName, pszGameName, sizeof(g_iszGameName));
|
||||
}
|
||||
|
||||
#ifdef GAME_DLL
|
||||
Q_strncpy( g_szDefaultPlayerModel, gameinfo->GetString( "player_default_model", "models/player.mdl" ), sizeof( g_szDefaultPlayerModel ) );
|
||||
g_bDefaultPlayerDrawExternally = gameinfo->GetBool( "player_default_draw_externally", false );
|
||||
#endif
|
||||
}
|
||||
gameinfo->deleteThis();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user