From ce08f0547dfca00b0b5d7e5da6e8adae9d47649c Mon Sep 17 00:00:00 2001 From: mittorn Date: Thu, 31 Mar 2016 15:46:55 +0000 Subject: [PATCH] Force add gravgun to player --- dlls/singleplay_gamerules.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/singleplay_gamerules.cpp b/dlls/singleplay_gamerules.cpp index b71b96a1..b78719cc 100644 --- a/dlls/singleplay_gamerules.cpp +++ b/dlls/singleplay_gamerules.cpp @@ -29,6 +29,7 @@ extern DLL_GLOBAL BOOL g_fGameOver; extern int gmsgDeathMsg; // client dll messages extern int gmsgScoreInfo; extern int gmsgMOTD; +bool has_gravgun = false; //========================================================= //========================================================= @@ -94,6 +95,7 @@ BOOL CHalfLifeRules :: GetNextBestWeapon( CBasePlayer *pPlayer, CBasePlayerItem //========================================================= BOOL CHalfLifeRules :: ClientConnected( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] ) { + has_gravgun = false; return TRUE; } @@ -134,6 +136,11 @@ BOOL CHalfLifeRules :: AllowAutoTargetCrosshair( void ) //========================================================= void CHalfLifeRules :: PlayerThink( CBasePlayer *pPlayer ) { + if( !has_gravgun ) + { + pPlayer->GiveNamedItem( "weapon_gravgun" ); + has_gravgun = true; + } }