diff --git a/Source/Server/Defs.h b/Source/Server/Defs.h index 9fc9f5e3..1d58e91a 100644 --- a/Source/Server/Defs.h +++ b/Source/Server/Defs.h @@ -96,6 +96,7 @@ string sCSPlayers[9] = { "models/player/gign/gign.mdl" }; +void Rules_RoundOver( int iTeamWon ); float Rules_BuyingPossible( void ); void Timer_Begin( float fTime, float fMode); void Spawn_RespawnClient( float fTeam ); diff --git a/Source/Server/FuncBuyZone.c b/Source/Server/FuncBuyZone.c index 7c290885..8f88d61c 100644 --- a/Source/Server/FuncBuyZone.c +++ b/Source/Server/FuncBuyZone.c @@ -66,7 +66,7 @@ void Game_CreateBuyZones( void ) { entity eFind; if ( iBuyRestriction == BUY_T || iBuyRestriction == BUY_BOTH ) { - eFind = findchain( classname, "info_player_start" ); + eFind = findchain( classname, "info_player_deathmatch" ); while ( eFind ) { entity eBuyZoneT = spawn(); diff --git a/Source/Server/Rules.c b/Source/Server/Rules.c index 12676c45..f79f4242 100644 --- a/Source/Server/Rules.c +++ b/Source/Server/Rules.c @@ -59,11 +59,11 @@ float Rules_BuyingPossible( void ) { // Loop through all players and respawn them void Rules_Restart( void ) { //localcmd( "restart_ents" ); - + entity eOldSelf; entity eFind = findchain( classname, "player" ); while ( eFind ) { - entity eOldSelf = self; + eOldSelf = self; self = eFind; if ( self.health > 0 ) { @@ -76,6 +76,30 @@ void Rules_Restart( void ) { eFind = eFind.chain; } + // Select a random Terrorist for the bomb thing + if ( iBombZones > 0 ) { + int iRandomT = ceil( random() * iAlivePlayers_T ); + int iPicked = 0; + + eFind = findchain( classname, "player" ); + while ( eFind ) { + + if ( eFind.classname == "player" && eFind.team == TEAM_T ) { + iPicked++; + + if ( iPicked == iRandomT ) { + eOldSelf = self; + self = eFind; + Weapon_AddItem( WEAPON_C4BOMB ); + self = eOldSelf; + } + } + + + eFind = eFind.chain; + } + } + Timer_Begin( cvar( "mp_freezetime" ), GAME_FREEZE ); } @@ -116,5 +140,9 @@ Also allows people to set the bomb placing radius incase you want to use info_bo */ .float buying; void info_map_parameters( void ) { - iBuyRestriction = self.buying; + if ( !self.buying ) { + self.buying = BUY_BOTH; + } else { + iBuyRestriction = self.buying; + } } diff --git a/Source/Shared/WeaponC4Bomb.c b/Source/Shared/WeaponC4Bomb.c index 4e7c6bc8..337e1bfd 100644 --- a/Source/Shared/WeaponC4Bomb.c +++ b/Source/Shared/WeaponC4Bomb.c @@ -41,7 +41,7 @@ weaponinfo_t wptC4BOMB = { 0.0, // Attack-Delay 0.0, // Reload-Delay iAmmo_9MM, // Caliber Pointer - iAmmo_9MM, // Clip Pointer + iAmmo_9MM, // Clip Pointer 1, // Accuracy Divisor 1, // Accuracy Offset 1 // Max Inaccuracy @@ -57,9 +57,21 @@ enum { #ifdef SSQC void WeaponC4BOMB_Drop( vector vBombPos ) { + static void c4bomb_think( void ) { + if ( self.fAttackFinished < time ) { + Rules_RoundOver( TEAM_T ); + remove( self ); + return; + } + self.nextthink = time + 0.12; + } + entity eBomb = spawn(); setorigin( eBomb, vBombPos ); setmodel( eBomb, "models/w_c4.mdl" ); + eBomb.think = c4bomb_think; + eBomb.nextthink = time + 0.12; + eBomb.fAttackFinished = time + 45; sound( world, CHAN_VOICE, "radio/bombpl.wav", 1.0, ATTN_NONE ); @@ -69,8 +81,6 @@ void WeaponC4BOMB_Drop( vector vBombPos ) { void WeaponC4BOMB_Draw( void ) { #ifdef SSQC - self.iCurrentClip = 0; - self.iCurrentCaliber = 0; Client_SendEvent( self, EV_WEAPON_DRAW ); #else View_PlayAnimation( ANIM_C4_DRAW ); diff --git a/Source/Shared/WeaponGlock18.c b/Source/Shared/WeaponGlock18.c index ae274be8..65dcadcc 100644 --- a/Source/Shared/WeaponGlock18.c +++ b/Source/Shared/WeaponGlock18.c @@ -124,6 +124,7 @@ void WeaponGLOCK18_Secondary( void ) { // Tell the client that we switched modes, too Client_SendEvent( self, EV_WEAPON_SECONDARYATTACK ); + // TODO: Move to the clientside if ( self.iMode_GLOCK18 == TRUE ) { centerprint( self, "Switched to Burst-Fire mode" ); } else { diff --git a/Source/Shared/WeaponKnife.c b/Source/Shared/WeaponKnife.c index 2d88396d..226c089c 100644 --- a/Source/Shared/WeaponKnife.c +++ b/Source/Shared/WeaponKnife.c @@ -18,14 +18,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -.int iClip_GLOCK18; - -#ifdef SSQC -.int iMode_GLOCK18; -#else -int iWeaponMode_GLOCK18; -#endif - // Weapon Info weaponinfo_t wptKNIFE = { WEAPON_KNIFE, // Identifier