int WinningCondition_LMS()
{
entity first_player = NULL;
- int total_players = 0;
+ int totalplayers = 0;
FOREACH_CLIENT(IS_PLAYER(it), {
- if (!total_players)
+ if (!totalplayers)
first_player = it;
- ++total_players;
+ ++totalplayers;
});
- if (total_players)
+ if (totalplayers)
{
- if (total_players > 1)
+ if (totalplayers > 1)
{
// two or more active players - continue with the game
#pragma once
// TODO: find a better location for these?
-float total_players;
+int total_players;
// todo: accept the number of teams as a parameter
void GameRules_teams(bool value);
#define SV_DAMAGETEXT_ALL() (autocvar_sv_damagetext >= 3)
MUTATOR_HOOKFUNCTION(damagetext, PlayerDamaged) {
if (SV_DAMAGETEXT_DISABLED()) return;
- const entity attacker = M_ARGV(0, entity);
- const entity hit = M_ARGV(1, entity); if (hit == attacker) return;
- const float health = M_ARGV(2, float);
- const float armor = M_ARGV(3, float);
- const int deathtype = M_ARGV(5, int);
- const float potential_damage = M_ARGV(6, float);
+ entity attacker = M_ARGV(0, entity);
+ entity hit = M_ARGV(1, entity); if (hit == attacker) return;
+ float health = M_ARGV(2, float);
+ float armor = M_ARGV(3, float);
+ int deathtype = M_ARGV(5, int);
+ float potential_damage = M_ARGV(6, float);
if(DEATH_WEAPONOF(deathtype) == WEP_VAPORIZER) return;
FOREACH_CLIENT(IS_REAL_CLIENT(it), {
if (
void DynamicHandicap_UpdateHandicap()
{
float total_score = 0;
- float total_players = 0;
+ float totalplayers = 0;
FOREACH_CLIENT(IS_PLAYER(it),
{
total_score += PlayerScore_Get(it, SP_SCORE);
- ++total_players;
+ ++totalplayers;
});
- float mean_score = total_score / total_players;
+ float mean_score = total_score / totalplayers;
FOREACH_CLIENT(true,
{
float score = PlayerScore_Get(it, SP_SCORE);
/** Called once per CSQC_UpdateView() */
void CSQCPlayer_SetCamera()
{
- const vector v0 = ((intermission && !autocvar_cl_movement_intermissionrunning) ? '0 0 0' : pmove_vel); // TRICK: pmove_vel is set by the engine when we get here. No need to network velocity
- const float vh = PHYS_VIEWHEIGHT(NULL);
- const vector pl_viewofs = PHYS_PL_VIEWOFS(NULL);
- const vector pl_viewofs_crouch = PHYS_PL_CROUCH_VIEWOFS(NULL);
- const entity e = csqcplayer;
+ vector v0 = ((intermission && !autocvar_cl_movement_intermissionrunning) ? '0 0 0' : pmove_vel); // TRICK: pmove_vel is set by the engine when we get here. No need to network velocity
+ float vh = PHYS_VIEWHEIGHT(NULL);
+ vector pl_viewofs = PHYS_PL_VIEWOFS(NULL);
+ vector pl_viewofs_crouch = PHYS_PL_CROUCH_VIEWOFS(NULL);
+ entity e = csqcplayer;
if (e)
{
if (servercommandframe == 0 || clientcommandframe == 0)
}
else
{
- const int flg = e.iflags; e.iflags &= ~(IFLAG_ORIGIN | IFLAG_ANGLES);
+ int flg = e.iflags; e.iflags &= ~(IFLAG_ORIGIN | IFLAG_ANGLES);
InterpolateOrigin_Do(e);
e.iflags = flg;
if (csqcplayer_status == CSQCPLAYERSTATUS_FROMSERVER)
{
- const vector o = e.origin;
+ vector o = e.origin;
csqcplayer_status = CSQCPLAYERSTATUS_PREDICTED;
CSQCPlayer_PredictTo(e, servercommandframe + 1, false);
CSQCPlayer_SetPredictionError(e.origin - o, e.velocity - v0, pmove_onground - IS_ONGROUND(e));