diff --git a/Source/gs-entbase/server/func_train.cpp b/Source/gs-entbase/server/func_train.cpp index 1bcd7002..3fb0171c 100644 --- a/Source/gs-entbase/server/func_train.cpp +++ b/Source/gs-entbase/server/func_train.cpp @@ -32,10 +32,10 @@ void func_train::GoToTarget(void) } vector vecWorldPos; - vecWorldPos[0] = absmin[0] + ( 0.5 * ( absmax[0] - absmin[0] ) ); - vecWorldPos[1] = absmin[1] + ( 0.5 * ( absmax[1] - absmin[1] ) ); - vecWorldPos[2] = absmin[2] + ( 0.5 * ( absmax[2] - absmin[2] ) ); - + vecWorldPos[0] = absmin[0] + (0.5 * (absmax[0] - absmin[0])); + vecWorldPos[1] = absmin[1] + (0.5 * (absmax[1] - absmin[1])); + vecWorldPos[2] = absmin[2] + (0.5 * (absmax[2] - absmin[2])); + vel_to_pos = (f.origin - vecWorldPos); flTravelTime = (vlen(vel_to_pos) / m_flSpeed); @@ -65,7 +65,7 @@ void func_train::NextPath(void) m_strTarget = current_target.m_strTarget; velocity = [0,0,0]; - + if (m_strTarget) { GoToTarget(); } @@ -89,9 +89,9 @@ void func_train::Find(void) print("^2func_train^7: Successfully found first target.\n"); vector vecWorldPos; - vecWorldPos[0] = absmin[0] + ( 0.5 * ( absmax[0] - absmin[0] ) ); - vecWorldPos[1] = absmin[1] + ( 0.5 * ( absmax[1] - absmin[1] ) ); - vecWorldPos[2] = absmin[2] + ( 0.5 * ( absmax[2] - absmin[2] ) ); + vecWorldPos[0] = absmin[0] + (0.5 * (absmax[0] - absmin[0])); + vecWorldPos[1] = absmin[1] + (0.5 * (absmax[1] - absmin[1])); + vecWorldPos[2] = absmin[2] + (0.5 * (absmax[2] - absmin[2])); vecWorldPos = f.origin - vecWorldPos; setorigin(this, vecWorldPos); @@ -113,8 +113,8 @@ void func_train::Respawn(void) void func_train::func_train(void) { - for ( int i = 1; i < ( tokenize( __fullspawndata ) - 1 ); i += 2 ) { - switch ( argv( i ) ) { + for (int i = 1; i < (tokenize(__fullspawndata) - 1); i += 2) { + switch (argv(i)) { case "speed": m_flSpeed = stof(argv(i+1)); break; diff --git a/Source/server/cstrike/ammo.c b/Source/server/cstrike/ammo.c index 9a48c3fe..e432f869 100644 --- a/Source/server/cstrike/ammo.c +++ b/Source/server/cstrike/ammo.c @@ -29,21 +29,21 @@ Buy ammo for the primary weapon you're equipped with */ void Ammo_BuyPrimary(void) { - if ( !self.fSlotPrimary ) { + if (!self.fSlotPrimary) { return; } - int iRequiredAmmo = ( ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iMaxAmount - self.(wptTable[ self.fSlotPrimary ].iCaliberfld)); - float fNew = ceil( ( (float)iRequiredAmmo / (float)ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iSize ) ); - for ( int i = 0; i < fNew; i++ ) { - if ( self.fMoney - ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iPrice < 0 ) { + int iRequiredAmmo = (ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iMaxAmount - self.(wptTable[ self.fSlotPrimary ].iCaliberfld)); + float fNew = ceil(((float)iRequiredAmmo / (float)ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iSize)); + for (int i = 0; i < fNew; i++) { + if (self.fMoney - ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iPrice < 0) { break; } - Money_AddMoney( self, -ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iPrice ); - sound( self, CHAN_ITEM, "items/9mmclip1.wav", 1, ATTN_IDLE ); + Money_AddMoney(self, -ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iPrice); + sound(self, CHAN_ITEM, "items/9mmclip1.wav", 1, ATTN_IDLE); self.(wptTable[ self.fSlotPrimary ].iCaliberfld) += ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iSize; - if ( self.(wptTable[ self.fSlotPrimary ].iCaliberfld) > ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iMaxAmount ) { + if (self.(wptTable[ self.fSlotPrimary ].iCaliberfld) > ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iMaxAmount) { self.(wptTable[ self.fSlotPrimary ].iCaliberfld) = ammoTable[ wptTable[ self.fSlotPrimary ].iCaliber ].iMaxAmount; } } @@ -58,22 +58,22 @@ Buy ammo for the secondary weapon you're equipped with */ void Ammo_BuySecondary(void) { - if ( !self.fSlotSecondary ) { + if (!self.fSlotSecondary) { return; } - int iRequiredAmmo = ( ammoTable[ wptTable[ self.fSlotSecondary ].iCaliber ].iMaxAmount - self.(wptTable[ self.fSlotSecondary ].iCaliberfld)); - float fNew = ceil( ( (float)iRequiredAmmo / (float)ammoTable[ wptTable[ self.fSlotSecondary ].iCaliber ].iSize ) ); + int iRequiredAmmo = (ammoTable[ wptTable[ self.fSlotSecondary ].iCaliber ].iMaxAmount - self.(wptTable[ self.fSlotSecondary ].iCaliberfld)); + float fNew = ceil(((float)iRequiredAmmo / (float)ammoTable[ wptTable[ self.fSlotSecondary ].iCaliber ].iSize)); - for ( int i = 0; i < fNew; i++ ) { - if ( self.fMoney - ammoTable[ wptTable[ self.fSlotSecondary ].iCaliber ].iPrice < 0 ) { + for (int i = 0; i < fNew; i++) { + if (self.fMoney - ammoTable[ wptTable[ self.fSlotSecondary ].iCaliber ].iPrice < 0) { break; } - Money_AddMoney( self, -ammoTable[ wptTable[ self.fSlotSecondary ].iCaliber ].iPrice ); - sound( self, CHAN_ITEM, "items/9mmclip1.wav", 1, ATTN_IDLE ); + Money_AddMoney(self, -ammoTable[ wptTable[ self.fSlotSecondary ].iCaliber ].iPrice); + sound(self, CHAN_ITEM, "items/9mmclip1.wav", 1, ATTN_IDLE); self.(wptTable[ self.fSlotSecondary ].iCaliberfld) += ammoTable[ wptTable[ self.fSlotSecondary ].iCaliber ].iSize; - if ( self.(wptTable[ self.fSlotSecondary ].iCaliberfld) > ammoTable[ wptTable[ self.fSlotSecondary ].iCaliber ].iMaxAmount ) { + if (self.(wptTable[ self.fSlotSecondary ].iCaliberfld) > ammoTable[ wptTable[ self.fSlotSecondary ].iCaliber ].iMaxAmount) { self.(wptTable[ self.fSlotSecondary ].iCaliberfld) = ammoTable[ wptTable[ self.fSlotSecondary ].iCaliber ].iMaxAmount; } } @@ -95,7 +95,7 @@ void Ammo_AutoFill(float fWeapon) void Ammo_Clear(void) { // Clear all the ammo stuff - for ( int i = 0; i < CS_WEAPON_COUNT; i++ ) { + for (int i = 0; i < CS_WEAPON_COUNT; i++) { self.(wptTable[ i ].iMagfld) = 0; self.(wptTable[ i ].iCaliberfld) = 0; } @@ -114,13 +114,13 @@ CSEv_GamePlayerBuyAmmo_f Called from the client, checks if he can buy ammo and does if yes ================= */ -void CSEv_GamePlayerBuyAmmo_f( float fType ) +void CSEv_GamePlayerBuyAmmo_f(float fType) { - if ( Rules_BuyingPossible() == FALSE ) { + if (Rules_BuyingPossible() == FALSE) { return; } - if ( fType == 0 ) { + if (fType == 0) { Ammo_BuyPrimary(); } else { Ammo_BuySecondary(); diff --git a/Source/server/cstrike/armoury_entity.cpp b/Source/server/cstrike/armoury_entity.cpp index 656f0a04..8e70d4bf 100755 --- a/Source/server/cstrike/armoury_entity.cpp +++ b/Source/server/cstrike/armoury_entity.cpp @@ -156,8 +156,8 @@ void armoury_entity::armoury_entity(void) return; } - for (int i = 1; i < (tokenize( __fullspawndata ) - 1); i += 2) { - switch ( argv( i ) ) { + for (int i = 1; i < (tokenize(__fullspawndata) - 1); i += 2) { + switch (argv(i)) { case "count": m_iCount = stoi(argv(i + 1)); break; diff --git a/Source/server/cstrike/defs.h b/Source/server/cstrike/defs.h index d2e28a69..e2def3e7 100755 --- a/Source/server/cstrike/defs.h +++ b/Source/server/cstrike/defs.h @@ -81,38 +81,38 @@ int iBombRadius; // For info_map_parameters int iHostagesRescued; int iBombPlanted; -void Rules_RoundOver( int iTeamWon, int iMoneyReward, float fSilent ); -float Rules_BuyingPossible( void ); -void Timer_Begin( float fTime, float fMode); -void Spawn_RespawnClient( float fTeam ); -void Spawn_CreateClient( float fTeam ); -void Spawn_MakeSpectator( void ); -void Client_SendEvent( entity eClient, float fEVType ); +void Rules_RoundOver(int iTeamWon, int iMoneyReward, float fSilent); +float Rules_BuyingPossible(void); +void Timer_Begin(float fTime, float fMode); +void Spawn_RespawnClient(float fTeam); +void Spawn_CreateClient(float fTeam); +void Spawn_MakeSpectator(void); +void Client_SendEvent(entity eClient, float fEVType); -void Weapon_Draw( float fWeapon ); -void Weapon_SwitchBest( void ); -void Weapon_UpdateCurrents( void ); -void Weapon_DropWeapon( int iSlot ); -float Weapon_GetAnimType( float fWeapon ); -float Weapon_GetFireRate( float fWeapon ); -float Weapon_GetReloadTime( float fWeapon ); -void Weapon_Reload( float fWeapon ); +void Weapon_Draw(float fWeapon); +void Weapon_SwitchBest(void); +void Weapon_UpdateCurrents(void); +void Weapon_DropWeapon(int iSlot); +float Weapon_GetAnimType(float fWeapon); +float Weapon_GetFireRate(float fWeapon); +float Weapon_GetReloadTime(float fWeapon); +void Weapon_Reload(float fWeapon); -void BaseGun_AccuracyCalc( void ); -void BaseGun_Draw( void ); -float BaseGun_PrimaryFire( void ); -float BaseGun_Reload( void ); +void BaseGun_AccuracyCalc(void); +void BaseGun_Draw(void); +float BaseGun_PrimaryFire(void); +float BaseGun_Reload(void); void Effect_CreateFlash(entity targ); -void BaseMelee_Draw( void ); -int BaseMelee_Attack( void ); +void BaseMelee_Draw(void); +int BaseMelee_Attack(void); void Ammo_AutoFill(float fWeapon); void Ammo_BuyPrimary(void); void Ammo_BuySecondary(void); -void Animation_PlayerTop( float fFrame ); -void Animation_PlayerTopTemp( float fFrame, float fTime ); +void Animation_PlayerTop(float fFrame); +void Animation_PlayerTopTemp(float fFrame, float fTime); -void Damage_Apply( entity eTarget, entity eAttacker, float iDamage, vector vHitPos, int iSkipArmor ); +void Damage_Apply(entity eTarget, entity eAttacker, float iDamage, vector vHitPos, int iSkipArmor); #define NULL __NULL__ diff --git a/Source/server/cstrike/func_buyzone.cpp b/Source/server/cstrike/func_buyzone.cpp index ff16a378..b0781bc1 100755 --- a/Source/server/cstrike/func_buyzone.cpp +++ b/Source/server/cstrike/func_buyzone.cpp @@ -15,7 +15,7 @@ class func_buyzone void func_buyzone::touch(void) { /* This will be cleared every frame inside SV_RunClientCommand */ - if((other.classname == "player" ) && (other.team == self.team)) { + if((other.classname == "player") && (other.team == self.team)) { other.fInBuyZone = TRUE; } } @@ -23,7 +23,7 @@ void func_buyzone::touch(void) void func_buyzone::func_buyzone(void) { if (autocvar_fcs_knifeonly == TRUE) { - remove( self ); + remove(self); return; } @@ -58,14 +58,14 @@ Game_CreateBuyZones Called by StartFrame if we somehow got no buy zones ================= */ -void Game_CreateBuyZones( void ) { +void Game_CreateBuyZones(void) { entity a; - if ( autocvar_fcs_knifeonly == TRUE ) { + if (autocvar_fcs_knifeonly == TRUE) { return; } - if ( iBuyRestriction == BUY_T || iBuyRestriction == BUY_BOTH ) { + if (iBuyRestriction == BUY_T || iBuyRestriction == BUY_BOTH) { for (a = world; (a = find(a, classname, "info_player_deathmatch"));) { func_buyzone zone = spawn(func_buyzone); setorigin(zone, a.origin); @@ -73,7 +73,7 @@ void Game_CreateBuyZones( void ) { } } - if ( iBuyRestriction == BUY_CT || iBuyRestriction == BUY_BOTH ) { + if (iBuyRestriction == BUY_CT || iBuyRestriction == BUY_BOTH) { for (a = world; (a = find(a, classname, "info_player_start"));) { func_buyzone zone = spawn(func_buyzone); setorigin(zone, a.origin); diff --git a/Source/server/cstrike/func_escapezone.cpp b/Source/server/cstrike/func_escapezone.cpp index bcd3c26a..07da4a65 100644 --- a/Source/server/cstrike/func_escapezone.cpp +++ b/Source/server/cstrike/func_escapezone.cpp @@ -24,7 +24,7 @@ void Escape_Touch(entity targ) self = targ; Spawn_MakeSpectator(); self.classname = "player"; - forceinfokey( self, "*dead", "0" ); + forceinfokey(self, "*dead", "0"); self.health = 0; Rules_CountPlayers(); self = eOld; @@ -62,10 +62,10 @@ void func_escapezone::func_escapezone(void) movetype = MOVETYPE_NONE; solid = SOLID_TRIGGER; - if ( model ) { - setmodel( self, model ); + if (model) { + setmodel(self, model); } else { - setsize( self, mins, maxs ); + setsize(self, mins, maxs); } model = 0; diff --git a/Source/server/cstrike/func_hostage_rescue.cpp b/Source/server/cstrike/func_hostage_rescue.cpp index 5c9a5529..b35ec46f 100644 --- a/Source/server/cstrike/func_hostage_rescue.cpp +++ b/Source/server/cstrike/func_hostage_rescue.cpp @@ -14,7 +14,7 @@ class func_hostage_rescue void func_hostage_rescue::touch(void) { - if ((other.classname == "player" ) && (other.team == TEAM_CT)) { + if ((other.classname == "player") && (other.team == TEAM_CT)) { /* This will be cleared every frame inside SV_RunClientCommand */ other.fInHostageZone = TRUE; } else if (other.classname == "hostage_entity") { @@ -28,7 +28,10 @@ void func_hostage_rescue::touch(void) iHostagesRescued++; Money_AddMoney(hosty.m_eRescuer, 1000); - Money_QueTeamReward(TEAM_CT, 800); + + /* In Hostage Rescue, all Counter-Terrorists receive an $850 + * bonus for every hostage they rescue, even if they lose the round. */ + Money_QueTeamReward(TEAM_CT, 850); CBaseEntity targa = (CBaseEntity)other; targa.Hide(); @@ -41,7 +44,7 @@ void func_hostage_rescue::touch(void) } } -void func_hostage_rescue::func_hostage_rescue( void ) +void func_hostage_rescue::func_hostage_rescue(void) { angles = '0 0 0'; movetype = MOVETYPE_NONE; diff --git a/Source/server/cstrike/info_map_parameters.cpp b/Source/server/cstrike/info_map_parameters.cpp index e228f529..911a38e0 100644 --- a/Source/server/cstrike/info_map_parameters.cpp +++ b/Source/server/cstrike/info_map_parameters.cpp @@ -13,8 +13,8 @@ class info_map_parameters void info_map_parameters::info_map_parameters(void) { - for (int i = 1; i < ( tokenize( __fullspawndata ) - 1 ); i += 2) { - switch ( argv( i ) ) { + for (int i = 1; i < (tokenize(__fullspawndata) - 1); i += 2) { + switch (argv(i)) { case "bombradius": iBombRadius = stoi(argv(i + 1)); #ifdef GS_DEVELOPER diff --git a/Source/server/cstrike/main.c b/Source/server/cstrike/main.c index 4137694a..6413805c 100644 --- a/Source/server/cstrike/main.c +++ b/Source/server/cstrike/main.c @@ -41,7 +41,7 @@ void Game_ParseClientCommand(string sCommand) } // Players talk to players, spectators to spectators. - if (self.health ) { + if (self.health) { if (argv(0) == "say") { localcmd(sprintf("echo %s: %s\n", self.netname, argv(1))); SV_SendChat(self, argv(1), world, 0); diff --git a/Source/server/cstrike/rules.c b/Source/server/cstrike/rules.c index bf57f257..1d399fa7 100755 --- a/Source/server/cstrike/rules.c +++ b/Source/server/cstrike/rules.c @@ -47,60 +47,60 @@ Rules_BuyingPossible Checks if it is possible for players to buy anything ================= */ -float Rules_BuyingPossible( void ) { - if ( self.health <= 0 ) { +float Rules_BuyingPossible(void) { + if (self.health <= 0) { return FALSE; } - if ( fGameState == GAME_ACTIVE ) { - if ( ( ( autocvar_mp_roundtime * 60 ) - fGameTime ) > autocvar_mp_buytime ) { - centerprint( self, sprintf( "%d seconds have passed...\nYou can't buy anything now!", autocvar_mp_buytime ) ); + if (fGameState == GAME_ACTIVE) { + if (((autocvar_mp_roundtime * 60) - fGameTime) > autocvar_mp_buytime) { + centerprint(self, sprintf("%d seconds have passed...\nYou can't buy anything now!", autocvar_mp_buytime)); self.fAttackFinished = time + 1.0; return FALSE; } } - if ( self.team == TEAM_VIP ) { - centerprint( self, "You are the VIP...\nYou can't buy anything!\n" ); + if (self.team == TEAM_VIP) { + centerprint(self, "You are the VIP...\nYou can't buy anything!\n"); self.fAttackFinished = time + 1.0; return FALSE; } - if ( iBuyRestriction == BUY_NEITHER ) { - centerprint( self, "Sorry, you aren't meant\nto be buying anything.\n" ); + if (iBuyRestriction == BUY_NEITHER) { + centerprint(self, "Sorry, you aren't meant\nto be buying anything.\n"); self.fAttackFinished = time + 1.0; return FALSE; } - if ( iBuyRestriction != BUY_BOTH ) { - if ( iBuyRestriction == BUY_CT && self.team == TEAM_T ) { - centerprint( self, "Terrorists aren't allowed to\nbuy anything on this map!\n" ); + if (iBuyRestriction != BUY_BOTH) { + if (iBuyRestriction == BUY_CT && self.team == TEAM_T) { + centerprint(self, "Terrorists aren't allowed to\nbuy anything on this map!\n"); self.fAttackFinished = time + 1.0; return FALSE; - } else if ( iBuyRestriction == BUY_T && self.team == TEAM_CT ) { - centerprint( self, "CTs aren't allowed to buy\nanything on this map!\n" ); + } else if (iBuyRestriction == BUY_T && self.team == TEAM_CT) { + centerprint(self, "CTs aren't allowed to buy\nanything on this map!\n"); self.fAttackFinished = time + 1.0; return FALSE; } } - if ( self.fInBuyZone == FALSE ) { + if (self.fInBuyZone == FALSE) { return FALSE; } 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_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 ) { +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" ); + Spawn_RespawnClient(self.team); + centerprint(self, "You are the VIP\nMake your way to the safety zones!"); + forceinfokey(self, "*dead", "2"); } /* @@ -110,23 +110,23 @@ Rules_Restart Loop through all ents and handle them ================= */ -void Rules_Restart( int iWipe ) { +void Rules_Restart(int iWipe) { iHostagesRescued = 0; entity eOld = self; // Spawn/Respawn everyone at their team position and give them $$$ - for ( entity eFind = world; ( eFind = find( eFind, classname, "player" ) ); ) { + for (entity eFind = world; (eFind = find(eFind, classname, "player"));) { self = eFind; - if ( self.health > 0 && iWipe == FALSE ) { - Spawn_RespawnClient( self.team ); + if (self.health > 0 && iWipe == FALSE) { + Spawn_RespawnClient(self.team); } else { Spawn_MakeSpectator(); - Spawn_CreateClient( self.fCharModel ); + Spawn_CreateClient(self.fCharModel); } - if ( iWipe == FALSE ) { + if (iWipe == FALSE) { Money_GiveTeamReward(); } else { self.fMoney = 0; @@ -135,25 +135,25 @@ void Rules_Restart( int iWipe ) { } // Clear the corpses/items - for ( entity eFind = world; ( eFind = find( eFind, classname, "remove_me" ) ); ) { - remove( eFind ); + for (entity eFind = world; (eFind = find(eFind, classname, "remove_me"));) { + remove(eFind); } // Find the bombs. Destory them! - for ( entity eFind = world; ( eFind = find( eFind, classname, "c4bomb" ) ); ) { - remove( eFind ); + for (entity eFind = world; (eFind = find(eFind, classname, "c4bomb"));) { + remove(eFind); } // Select a random Terrorist for the bomb, if needed - if ( iBombZones > 0 ) { - int iRandomT = floor( random( 1, (float)iAlivePlayers_T + 1 ) ); + if (iBombZones > 0) { + int iRandomT = floor(random(1, (float)iAlivePlayers_T + 1)); int iPickT = 0; - for ( entity eFind = world; ( eFind = find( eFind, classname, "player" ) ); ) { - if ( eFind.team == TEAM_T ) { + for (entity eFind = world; (eFind = find(eFind, classname, "player"));) { + if (eFind.team == TEAM_T) { iPickT++; - if ( iPickT == iRandomT ) { + if (iPickT == iRandomT) { self = eFind; Rules_MakeBomber(); } @@ -162,14 +162,14 @@ void Rules_Restart( int iWipe ) { } // If there is a VIP, select a random CT to be it - if ( iVIPZones > 0 ) { - int iRandomCT = floor( random( 1, (float)iAlivePlayers_CT + 1 ) ); + if (iVIPZones > 0) { + int iRandomCT = floor(random(1, (float)iAlivePlayers_CT + 1)); int iPickCT = 0; - for ( entity eFind = world; ( eFind = find( eFind, classname, "player" ) ); ) { - if ( eFind.team == TEAM_CT ) { + for (entity eFind = world; (eFind = find(eFind, classname, "player"));) { + if (eFind.team == TEAM_CT) { iPickCT++; - if ( iPickCT == iRandomCT ) { + if (iPickCT == iRandomCT) { self = eFind; Rules_MakeVIP(); } @@ -186,7 +186,7 @@ void Rules_Restart( int iWipe ) { self = eOld; - Timer_Begin( autocvar_mp_freezetime, GAME_FREEZE ); + Timer_Begin(autocvar_mp_freezetime, GAME_FREEZE); Money_ResetTeamReward(); fDefuseProgress = 0; } @@ -198,35 +198,38 @@ Rules_RoundOver This happens whenever an objective is complete or time is up ================= */ -void Rules_RoundOver( int iTeamWon, int iMoneyReward, float fSilent ) { +void Rules_RoundOver(int iTeamWon, int iMoneyReward, float fSilent) { - if ( fGameState != GAME_ACTIVE ) { + if (fGameState != GAME_ACTIVE) { return; } - - if ( iTeamWon == TEAM_T ) { - if ( fSilent == FALSE ) { - Radio_BroadcastMessage( RADIO_TERWIN ); + + if (iTeamWon == TEAM_T) { + if (fSilent == FALSE) { + Radio_BroadcastMessage(RADIO_TERWIN); } iWon_T++; - - Money_HandleRoundReward(TEAM_T); - } else if ( iTeamWon == TEAM_CT ) { - if ( fSilent == FALSE ) { - Radio_BroadcastMessage( RADIO_CTWIN ); + } else if (iTeamWon == TEAM_CT) { + if (fSilent == FALSE) { + Radio_BroadcastMessage(RADIO_CTWIN); } iWon_CT++; - Money_HandleRoundReward(TEAM_CT); + /* In Bomb Defusal, if Terrorists were able to plant the bomb + * but lose the round, all Terrorists receive an $800 bonus. */ + if (iBombPlanted) { + Money_QueTeamReward(TEAM_T, 800); + } } else { - if ( fSilent == FALSE ) { - Radio_BroadcastMessage( RADIO_ROUNDDRAW ); + if (fSilent == FALSE) { + Radio_BroadcastMessage(RADIO_ROUNDDRAW); } } - - Money_QueTeamReward( iTeamWon, iMoneyReward ); - Timer_Begin( 5, GAME_END); // Round is over, 5 seconds til a new round starts - + + Money_HandleRoundReward(iTeamWon); + Money_QueTeamReward(iTeamWon, iMoneyReward); + Timer_Begin(5, GAME_END); // Round is over, 5 seconds til a new round starts + iBombPlanted = 0; iRounds++; } @@ -238,18 +241,18 @@ Rules_TimeOver Whenever mp_roundtime was being counted down to 0 ================= */ -void Rules_TimeOver( void ) { - if ( iVIPZones > 0 ) { - Rules_RoundOver( TEAM_T, 3250, FALSE ); - } else if ( iBombZones > 0 ) { +void Rules_TimeOver(void) { + if (iVIPZones > 0) { + Rules_RoundOver(TEAM_T, 3250, FALSE); + } else if (iBombZones > 0) { /* In Bomb Defusal, all Counter-Terrorists receive $3250 * if they won running down the time. */ - Rules_RoundOver( TEAM_CT, 3250, FALSE ); - } else if ( iHostagesMax > 0 ) { + Rules_RoundOver(TEAM_CT, 3250, FALSE); + } else if (iHostagesMax > 0) { // TODO: Broadcast_Print: Hostages have not been rescued! - Rules_RoundOver( TEAM_T, 3250, FALSE ); + Rules_RoundOver(TEAM_T, 3250, FALSE); } else { - Rules_RoundOver( 0, 0, FALSE ); + Rules_RoundOver(0, 0, FALSE); } } @@ -260,7 +263,7 @@ Rules_SwitchTeams Happens rarely ================= */ -void Rules_SwitchTeams( void ) { +void Rules_SwitchTeams(void) { int iCTW, iTW; for (entity eFind = world; (eFind = find(eFind, classname, "player"));) { @@ -292,9 +295,9 @@ void Rules_CountPlayers(void) iAlivePlayers_T = 0; iAlivePlayers_CT = 0; - for (entity eFind = world; (eFind = find(eFind, classname, "player")); ) { + for (entity eFind = world; (eFind = find(eFind, classname, "player"));) { if (eFind.health > 0) { - if ( eFind.team == TEAM_T) { + if (eFind.team == TEAM_T) { iAlivePlayers_T++; } else if (eFind.team == TEAM_CT) { iAlivePlayers_CT++; @@ -307,17 +310,17 @@ void Rules_CountPlayers(void) void Rules_DeathCheck(void) { - if ( ( iAlivePlayers_T == 0 ) && ( iAlivePlayers_CT == 0 ) ) { - if ( iBombPlanted == TRUE ) { - Rules_RoundOver( TEAM_T, 3600, FALSE ); + if ((iAlivePlayers_T == 0) && (iAlivePlayers_CT == 0)) { + if (iBombPlanted == TRUE) { + Rules_RoundOver(TEAM_T, 3600, FALSE); } else { - Rules_RoundOver( FALSE, 0, FALSE ); + Rules_RoundOver(FALSE, 0, FALSE); } } else { int winner; - if ( ( self.team == TEAM_T ) && ( iAlivePlayers_T == 0 ) ) { + if ((self.team == TEAM_T) && (iAlivePlayers_T == 0)) { winner = TEAM_CT; - } else if ( ( self.team == TEAM_CT ) && ( iAlivePlayers_CT == 0 ) ) { + } else if ((self.team == TEAM_CT) && (iAlivePlayers_CT == 0)) { winner = TEAM_T; } else { return; @@ -325,11 +328,11 @@ void Rules_DeathCheck(void) if (iBombZones > 0) { /* In Bomb Defusal, the winning team receives $3250 - * if they won by eliminating the enemy team. */ + * if they won by eliminating the enemy team. */ Rules_RoundOver(winner, 3250, FALSE); } else { /* In Hostage Rescue, the winning team receives $3600 - * if they won by eliminating the enemy team. */ + * if they won by eliminating the enemy team. */ Rules_RoundOver(winner, 3600, FALSE); } } diff --git a/Source/server/cstrike/timer.c b/Source/server/cstrike/timer.c index 86ee5252..fef59b0a 100644 --- a/Source/server/cstrike/timer.c +++ b/Source/server/cstrike/timer.c @@ -41,7 +41,7 @@ void Timer_Update(void) { static float fVoxTimer; - if ( cvar( "sv_playerslots" ) == 1 ) { + if (cvar("sv_playerslots") == 1) { fGameTime = -1; return; } diff --git a/cstrike/data.pk3dir/progs.dat b/cstrike/data.pk3dir/progs.dat index 1542bfae..4d1bd47c 100644 Binary files a/cstrike/data.pk3dir/progs.dat and b/cstrike/data.pk3dir/progs.dat differ