Cleanup: Some CGameRules methods are now of type 'bool'
Remove rules.qc
This commit is contained in:
parent
91c05a3bad
commit
164308a4f6
5 changed files with 21 additions and 29 deletions
|
@ -28,7 +28,7 @@ class CSGameRules:CGameRules
|
|||
virtual void(NSClientPlayer) LevelDecodeParms;
|
||||
virtual void(void) LevelNewParms;
|
||||
|
||||
virtual int(NSClientPlayer) BuyingPossible;
|
||||
virtual bool(NSClientPlayer) BuyingPossible;
|
||||
};
|
||||
|
||||
class CSSingleplayerRules:CSGameRules
|
||||
|
@ -52,7 +52,7 @@ class CSMultiplayerRules:CSGameRules
|
|||
virtual void(NSClientPlayer) PlayerPreFrame;
|
||||
virtual void(NSClientPlayer) PlayerDeath;
|
||||
virtual int(int) MaxItemPerSlot;
|
||||
virtual float(NSClientPlayer, string) ConsoleCommand;
|
||||
virtual bool(NSClientPlayer, string) ConsoleCommand;
|
||||
|
||||
/* CS specific */
|
||||
virtual void(void) CreateRescueZones;
|
||||
|
@ -61,7 +61,7 @@ class CSMultiplayerRules:CSGameRules
|
|||
virtual void(float, int) TimerBegin;
|
||||
virtual void(void) TimerUpdate;
|
||||
|
||||
virtual int(NSClientPlayer) BuyingPossible;
|
||||
virtual bool(NSClientPlayer) BuyingPossible;
|
||||
virtual void(int, int, int) RoundOver;
|
||||
virtual void(int) RestartRound;
|
||||
virtual void(NSClientPlayer) DeathCheck;
|
||||
|
@ -70,7 +70,7 @@ class CSMultiplayerRules:CSGameRules
|
|||
virtual void(void) CountPlayers;
|
||||
virtual void(void) SwitchTeams;
|
||||
virtual void(void) TimeOut;
|
||||
virtual float(void) IsTeamPlay;
|
||||
virtual bool(void) IsTeamplay;
|
||||
|
||||
virtual void(NSClientPlayer) PlayerClearWeaponry;
|
||||
virtual void(NSClientPlayer, int) PlayerMakePlayable;
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
var int autocvar_sv_playerkeepalive = TRUE;
|
||||
|
||||
void
|
||||
CSGameRules::PlayerDeath(NSClientPlayer pl)
|
||||
{
|
||||
|
@ -26,10 +24,10 @@ CSGameRules::PlayerPain(NSClientPlayer pl)
|
|||
{
|
||||
}
|
||||
|
||||
int
|
||||
bool
|
||||
CSGameRules::BuyingPossible(NSClientPlayer pl)
|
||||
{
|
||||
return (0);
|
||||
return (false);
|
||||
}
|
||||
|
||||
/* we check what fields have changed over the course of the frame and network
|
||||
|
|
|
@ -341,46 +341,46 @@ BuyingPossible
|
|||
Checks if it is possible for players to buy anything
|
||||
=================
|
||||
*/
|
||||
int
|
||||
bool
|
||||
CSMultiplayerRules::BuyingPossible(NSClientPlayer pl)
|
||||
{
|
||||
if (pl.health <= 0) {
|
||||
return (0);
|
||||
return (false);
|
||||
}
|
||||
|
||||
if (g_cs_gamestate == GAME_ACTIVE) {
|
||||
if (((autocvar_mp_roundtime * 60) - g_cs_gametime) > autocvar_mp_buytime) {
|
||||
centerprint(pl, sprintf("%d seconds have passed...\nYou can't buy anything now!", autocvar_mp_buytime));
|
||||
return (0);
|
||||
return (false);
|
||||
}
|
||||
}
|
||||
|
||||
if (pl.team == TEAM_VIP) {
|
||||
centerprint(pl, "You are the VIP...\nYou can't buy anything!\n");
|
||||
return (0);
|
||||
return (false);
|
||||
}
|
||||
|
||||
if (g_cstrike_buying == BUY_NEITHER) {
|
||||
centerprint(pl, "Sorry, you aren't meant\nto be buying anything.\n");
|
||||
return (0);
|
||||
return (false);
|
||||
}
|
||||
|
||||
if (g_cstrike_buying != BUY_BOTH) {
|
||||
if (g_cstrike_buying == BUY_CT && pl.team == TEAM_T) {
|
||||
centerprint(pl, "Terrorists aren't allowed to\nbuy anything on this map!\n");
|
||||
return (0);
|
||||
return (false);
|
||||
} else if (g_cstrike_buying == BUY_T && pl.team == TEAM_CT) {
|
||||
centerprint(pl, "CTs aren't allowed to buy\nanything on this map!\n");
|
||||
return (0);
|
||||
return (false);
|
||||
}
|
||||
}
|
||||
|
||||
if (!(pl.gflags & GF_BUYZONE)) {
|
||||
centerprint(pl, "Sorry, you aren't in a buyzone.\n");
|
||||
return (0);
|
||||
return (false);
|
||||
}
|
||||
|
||||
return (1);
|
||||
return (true);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -945,7 +945,7 @@ CSMultiplayerRules_BotJoin(void)
|
|||
CSEv_JoinAuto();
|
||||
}
|
||||
|
||||
float
|
||||
bool
|
||||
CSMultiplayerRules::ConsoleCommand(NSClientPlayer pp, string cmd)
|
||||
{
|
||||
tokenize(cmd);
|
||||
|
@ -959,16 +959,16 @@ CSMultiplayerRules::ConsoleCommand(NSClientPlayer pp, string cmd)
|
|||
}
|
||||
break;
|
||||
default:
|
||||
return (0);
|
||||
return (false);
|
||||
}
|
||||
|
||||
return (1);
|
||||
return (true);
|
||||
}
|
||||
|
||||
float
|
||||
CSMultiplayerRules::IsTeamPlay(void)
|
||||
bool
|
||||
CSMultiplayerRules::IsTeamplay(void)
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -50,7 +50,6 @@ ammo.qc
|
|||
buy.qc
|
||||
server.qc
|
||||
../../../base/src/server/damage.qc
|
||||
rules.qc
|
||||
../../../valve/src/server/flashlight.qc
|
||||
../../../base/src/server/modelevent.qc
|
||||
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
int
|
||||
Rules_IsTeamPlay(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
Loading…
Reference in a new issue