Cleanup: Some CGameRules methods are now of type 'bool'

Remove rules.qc
This commit is contained in:
Marco Cawthorne 2022-07-16 15:09:00 -07:00
parent 58ef5dc162
commit 92c2b54ef0
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
5 changed files with 14 additions and 34 deletions

View File

@ -178,7 +178,7 @@ Scores_Draw(void)
pos = video_mins + [(video_res[0] / 2) - 145, 30];
}
if (Util_IsTeamPlay()) {
if (Util_IsTeamplay()) {
Scores_DrawTeam(pl, pos);
} else {
Scores_DrawNormal(pl, pos);

View File

@ -46,13 +46,13 @@ class HLMultiplayerRules:HLGameRules
virtual void(void) FrameStart;
virtual void(void) CheckRules;
virtual int(void) MonstersSpawn;
virtual bool(void) MonstersSpawn;
/* client */
virtual void(NSClientPlayer) PlayerSpawn;
virtual void(NSClientPlayer) PlayerDeath;
virtual float(NSClientPlayer, string) ConsoleCommand;
virtual bool(NSClientPlayer, string) ConsoleCommand;
virtual bool(void) IsMultiplayer;
virtual bool(void) IsTeamPlay;
virtual bool(void) IsTeamplay;
virtual void(void) InitPostEnts;
};

View File

@ -24,7 +24,7 @@ HLMultiplayerRules::IsMultiplayer(void)
}
bool
HLMultiplayerRules::IsTeamPlay(void)
HLMultiplayerRules::IsTeamplay(void)
{
return cvar("mp_teamplay") == 1 ? true : false;
}
@ -32,7 +32,7 @@ HLMultiplayerRules::IsTeamPlay(void)
void
HLMultiplayerRules::InitPostEnts(void)
{
if (IsTeamPlay() == true) {
if (IsTeamplay() == true) {
int c;
/* get the segments from our cvar */
@ -181,7 +181,7 @@ HLMultiplayerRules::PlayerSpawn(NSClientPlayer pp)
pl.glock_mag = 18;
pl.ammo_9mm = 44;
if (IsTeamPlay() == true) {
if (IsTeamplay() == true) {
int c = tokenizebyseparator(m_strTeamList, ";");
/* not part of a team? pick one of the ones we have */
@ -209,7 +209,7 @@ HLMultiplayerRules::PlayerSpawn(NSClientPlayer pp)
Client_FixAngle(pl, pl.angles);
}
float
bool
HLMultiplayerRules::ConsoleCommand(NSClientPlayer pp, string cmd)
{
tokenize(cmd);
@ -231,16 +231,16 @@ HLMultiplayerRules::ConsoleCommand(NSClientPlayer pp, string cmd)
pp.velocity = Route_GetJumpVelocity(pp.origin, trace_endpos, pp.gravity);
break;
default:
return (0);
return (false);
}
return (1);
return (true);
}
int
bool
HLMultiplayerRules::MonstersSpawn(void)
{
return (FALSE);
return (false);
}
void
@ -261,7 +261,7 @@ CSEv_HLDM_Chooseteam_s(string teamname)
return;
if (rules.IsMultiplayer() == false)
return;
if (rules.IsTeamPlay() == false)
if (rules.IsTeamplay() == false)
return;
if (pl.health <= 0)
return;
@ -274,6 +274,7 @@ CSEv_HLDM_Chooseteam_s(string teamname)
pl.team = (float)i + 1;
forceinfokey(pl, "*team", sprintf("%d", pl.team));
Damage_Apply(pl, pl, 100, 0, DMG_SKIP_ARMOR);
return;
}
}
}

View File

@ -77,7 +77,6 @@ gamerules_multiplayer.qc
client.qc
server.qc
../../../base/src/server/damage.qc
rules.qc
flashlight.qc
../../../base/src/server/modelevent.qc

View File

@ -1,20 +0,0 @@
/*
* Copyright (c) 2016-2020 Marco Cawthorne <marco@icculus.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
int Rules_IsTeamPlay(void)
{
return cvar("teamplay");
}