diff --git a/Source/Client/View.c b/Source/Client/View.c index d67b5815..991c1462 100755 --- a/Source/Client/View.c +++ b/Source/Client/View.c @@ -174,7 +174,6 @@ void View_DrawViewModel( void ) { makevectors( '0 0 0'); eViewModel.origin = '0 0 -1' + ( v_forward * ( pSeat->fBob * 0.4 ) ); - eViewModel.angles = pSeat->vPunchAngle; // Left-handed weapons if ( autocvar_v_lefthanded ) { diff --git a/Source/FreeCS-CE.prj b/Source/FreeCS-CE.prj index 32523f1e..73885673 100644 --- a/Source/FreeCS-CE.prj +++ b/Source/FreeCS-CE.prj @@ -1,5 +1,5 @@ - + @@ -73,7 +73,7 @@ - + diff --git a/Source/Menu/Input.c b/Source/Menu/Input.c index 4d12a12d..1f637b57 100755 --- a/Source/Menu/Input.c +++ b/Source/Menu/Input.c @@ -100,7 +100,6 @@ float Menu_InputEvent( float fEventType, float fKey, float fCharacter, float fDe if ( fKey == K_ESCAPE ) { m_toggle( 0 ); } - fInputKeyDown = 1; } diff --git a/Source/Server/Ammo.c b/Source/Server/Ammo.c index df24fe22..e8bea005 100755 --- a/Source/Server/Ammo.c +++ b/Source/Server/Ammo.c @@ -48,12 +48,16 @@ void Ammo_BuyPrimary( float fFree ) { float fNew = ceil( ( (float)iRequiredAmmo / (float)ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iSize ) ); for ( int i = 0; i < fNew; i++ ) { - self.(wptTable[ self.fSlotPrimary ].iCaliberfld) += ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iSize; - Money_AddMoney( self, -ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iPrice ); - sound( self, CHAN_ITEM, "items/9mmclip1.wav", 1, ATTN_IDLE ); - - if ( self.(wptTable[ self.fSlotPrimary ].iCaliberfld) > ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iMaxAmount ) { - self.(wptTable[ self.fSlotPrimary ].iCaliberfld) = ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iMaxAmount; + if ( self.fMoney - ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iPrice >= 0 ) { + self.(wptTable[ self.fSlotPrimary ].iCaliberfld) += ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iSize; + Money_AddMoney( self, -ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iPrice ); + sound( self, CHAN_ITEM, "items/9mmclip1.wav", 1, ATTN_IDLE ); + + if ( self.(wptTable[ self.fSlotPrimary ].iCaliberfld) > ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iMaxAmount ) { + self.(wptTable[ self.fSlotPrimary ].iCaliberfld) = ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iMaxAmount; + } + } else { + break; } } } diff --git a/Source/Server/Defs.h b/Source/Server/Defs.h index 50feed8f..b0c70079 100755 --- a/Source/Server/Defs.h +++ b/Source/Server/Defs.h @@ -31,6 +31,8 @@ var float autocvar_mp_fillweapons = 0; var float autocvar_mp_timelimit = 60; var string autocvar_motdfile = "motd.txt"; +var int autocvar_mp_autoreload = FALSE; + // Mapcycle features var string autocvar_mapcyclefile = "mapcycle.txt"; diff --git a/Source/Server/Main.c b/Source/Server/Main.c index 785965ac..eabc0bdc 100755 --- a/Source/Server/Main.c +++ b/Source/Server/Main.c @@ -93,6 +93,7 @@ float ConsoleCmd( string sCommand ) { multicast( '0 0 0', MULTICAST_ALL ); return TRUE; } + return FALSE; } diff --git a/Source/Server/Rules.c b/Source/Server/Rules.c index a42e9c53..ef9f62ab 100755 --- a/Source/Server/Rules.c +++ b/Source/Server/Rules.c @@ -76,6 +76,18 @@ float Rules_BuyingPossible( void ) { return TRUE; } +void Rules_MakeBomber( void ) { + Weapon_AddItem( WEAPON_C4BOMB ); + centerprint( self, "You have the bomb!\nFind the target zone or DROP\nthe bomb for another Terrorist." ); +} + +void Rules_MakeVIP( void ) { + self.team = TEAM_VIP; + Spawn_RespawnClient( self.team ); + centerprint( self, "You are the VIP\nMake your way to the safety zones!" ); + forceinfokey( self, "*dead", "2" ); +} + /* ================= Rules_Restart @@ -122,8 +134,7 @@ void Rules_Restart( void ) { if ( iPickT == iRandomT ) { self = eFind; - Weapon_AddItem( WEAPON_C4BOMB ); - centerprint( self, "You have the bomb!\nFind the target zone or DROP\nthe bomb for another Terrorist." ); + Rules_MakeBomber(); } } } @@ -139,10 +150,7 @@ void Rules_Restart( void ) { iPickCT++; if ( iPickCT == iRandomCT ) { self = eFind; - self.team = TEAM_VIP; - Spawn_RespawnClient( self.team ); - centerprint( self, "You are the VIP\nMake your way to the safety zones!" ); - forceinfokey( self, "*dead", "2" ); + Rules_MakeVIP(); } } } diff --git a/Source/Server/Spawn.c b/Source/Server/Spawn.c index c224400a..3fa09988 100755 --- a/Source/Server/Spawn.c +++ b/Source/Server/Spawn.c @@ -211,6 +211,7 @@ void Spawn_MakeSpectator( void ) { self.classname = "spectator"; self.health = 0; + self.armor = 0; self.takedamage = DAMAGE_NO; self.solid = SOLID_NOT; self.movetype = MOVETYPE_NOCLIP; @@ -231,7 +232,7 @@ void Spawn_MakeSpectator( void ) { } // Clear the inventory - self.fSlotMelee = self.fSlotPrimary = self.fSlotSecondary = self.fSlotGrenade = 0; + self.fSlotMelee = self.fSlotPrimary = self.fSlotSecondary = self.fSlotGrenade = self.iEquipment = 0; } /* @@ -264,15 +265,22 @@ void CSEv_GamePlayerSpawn_f( float fChar ) { self.fSlotGrenade = 0; self.iEquipment = 0; - if ( iAlivePlayers_T + iAlivePlayers_CT == 1 ) { - Rules_RoundOver( 0, 0, FALSE ); - } - // Spawn the players immediately when its in the freeze state switch ( fGameState ) { case GAME_FREEZE: self.fCharModel = fChar; Spawn_CreateClient( fChar ); + + if ( ( self.team == TEAM_T ) && ( iAlivePlayers_T == 1 ) ) { + if ( iBombZones > 0 ) { + Rules_MakeBomber(); + } + } else if ( ( self.team == TEAM_CT ) && ( iAlivePlayers_CT == 1 ) ) { + if ( iVIPZones > 0 ) { + Rules_MakeVIP(); + } + } + break; default: if ( fChar == 0 ) { @@ -296,6 +304,13 @@ void CSEv_GamePlayerSpawn_f( float fChar ) { self.frags = 0; self.fDeaths = 0; forceinfokey( self, "*deaths", "0" ); + + // Split up for readability and expandability? + if ( ( self.team == TEAM_T ) && ( iAlivePlayers_T == 0 ) ) { + Rules_RoundOver( FALSE, 0, FALSE ); + } else if ( ( self.team == TEAM_CT ) && ( iAlivePlayers_CT == 0 ) ) { + Rules_RoundOver( FALSE, 0, FALSE ); + } } /* diff --git a/Source/Shared/WeaponC4Bomb.c b/Source/Shared/WeaponC4Bomb.c index 8d850a45..4056af9a 100755 --- a/Source/Shared/WeaponC4Bomb.c +++ b/Source/Shared/WeaponC4Bomb.c @@ -228,7 +228,7 @@ void WeaponC4BOMB_PrimaryFire( void ) { // 3 seconds have passed, plant the bomb if ( self.fBombProgress <= time ) { - WeaponC4BOMB_Drop( trace_endpos ); + WeaponC4BOMB_Drop( trace_endpos, trace_plane_normal ); } #else View_PlayAnimation( ANIM_C4_ENTERCODE ); diff --git a/Source/Shared/WeaponFlashbang.c b/Source/Shared/WeaponFlashbang.c index 48287387..24d681cc 100755 --- a/Source/Shared/WeaponFlashbang.c +++ b/Source/Shared/WeaponFlashbang.c @@ -138,6 +138,7 @@ void WeaponFLASHBANG_Throw( void ) { setsize( eNade, '-4 -4 -4', '4 4 4' ); vector vDir = aim ( self, 100000 ); + eNade.classname = "remove_me"; eNade.owner = self; eNade.solid = SOLID_TRIGGER; eNade.angles = vectoangles( vDir ); diff --git a/Source/Shared/WeaponHEGrenade.c b/Source/Shared/WeaponHEGrenade.c index 92f43678..a60f0600 100755 --- a/Source/Shared/WeaponHEGrenade.c +++ b/Source/Shared/WeaponHEGrenade.c @@ -122,6 +122,7 @@ void WeaponHEGRENADE_Throw( void ) { vector vDir = aim ( self, 100000 ); eNade.owner = self; + eNade.classname = "remove_me"; eNade.solid = SOLID_TRIGGER; // This is so grenades will not get slowed down by windows they touch eNade.angles = vectoangles( vDir ); eNade.velocity = ( vDir * 800 ); diff --git a/Source/Shared/WeaponSmokeGrenade.c b/Source/Shared/WeaponSmokeGrenade.c index e470ac57..013adb5e 100755 --- a/Source/Shared/WeaponSmokeGrenade.c +++ b/Source/Shared/WeaponSmokeGrenade.c @@ -130,6 +130,7 @@ void WeaponSMOKEGRENADE_Throw( void ) { setsize( eNade, '-4 -4 -4', '4 4 4' ); vector vDir = aim ( self, 100000 ); + eNade.classname = "remove_me"; eNade.owner = self; eNade.solid = SOLID_TRIGGER; eNade.angles = vectoangles( vDir ); diff --git a/Source/Shared/Weapons.c b/Source/Shared/Weapons.c index dd160234..7b350a46 100755 --- a/Source/Shared/Weapons.c +++ b/Source/Shared/Weapons.c @@ -447,8 +447,6 @@ void Weapon_DropWeapon( int iSlot ) { return; } - - entity eDrop = spawn(); setorigin( eDrop, self.origin + self.view_ofs ); setmodel( eDrop, sWeaponModels[ fWeapon ] ); diff --git a/freecs/csprogs.dat b/freecs/csprogs.dat index 7f26765b..80d6bf7d 100644 Binary files a/freecs/csprogs.dat and b/freecs/csprogs.dat differ diff --git a/freecs/progs.dat b/freecs/progs.dat index ea8d1f0b..4e8e4e0d 100644 Binary files a/freecs/progs.dat and b/freecs/progs.dat differ