From bdef08d3e34eedd11dbb8a39f9f074ae8b21c459 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 18 Sep 2018 12:29:20 +1000 Subject: [PATCH] Fix a few FTEQCC compilation warnings (variable const isn't a thing) --- qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc | 10 +++++----- qcsrc/common/gamemodes/sv_rules.qh | 2 +- .../mutators/mutator/damagetext/sv_damagetext.qc | 12 ++++++------ .../dynamic_handicap/sv_dynamic_handicap.qc | 6 +++--- qcsrc/lib/csqcmodel/cl_player.qc | 14 +++++++------- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc index ffbecf1b3..493320cce 100644 --- a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc +++ b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc @@ -36,16 +36,16 @@ void ClearWinners(); 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 diff --git a/qcsrc/common/gamemodes/sv_rules.qh b/qcsrc/common/gamemodes/sv_rules.qh index ca1b6f8e7..f8950684b 100644 --- a/qcsrc/common/gamemodes/sv_rules.qh +++ b/qcsrc/common/gamemodes/sv_rules.qh @@ -1,7 +1,7 @@ #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); diff --git a/qcsrc/common/mutators/mutator/damagetext/sv_damagetext.qc b/qcsrc/common/mutators/mutator/damagetext/sv_damagetext.qc index d9eacaae0..0e0aa13fd 100644 --- a/qcsrc/common/mutators/mutator/damagetext/sv_damagetext.qc +++ b/qcsrc/common/mutators/mutator/damagetext/sv_damagetext.qc @@ -10,12 +10,12 @@ REGISTER_MUTATOR(damagetext, true); #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 ( diff --git a/qcsrc/common/mutators/mutator/dynamic_handicap/sv_dynamic_handicap.qc b/qcsrc/common/mutators/mutator/dynamic_handicap/sv_dynamic_handicap.qc index d5d3ba40f..4cfc0dd23 100644 --- a/qcsrc/common/mutators/mutator/dynamic_handicap/sv_dynamic_handicap.qc +++ b/qcsrc/common/mutators/mutator/dynamic_handicap/sv_dynamic_handicap.qc @@ -32,13 +32,13 @@ float DynamicHandicap_ClampHandicap(float handicap); 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); diff --git a/qcsrc/lib/csqcmodel/cl_player.qc b/qcsrc/lib/csqcmodel/cl_player.qc index f87f00033..268b59126 100644 --- a/qcsrc/lib/csqcmodel/cl_player.qc +++ b/qcsrc/lib/csqcmodel/cl_player.qc @@ -210,11 +210,11 @@ bool CSQCPlayer_IsLocalPlayer(entity this) /** 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) @@ -239,13 +239,13 @@ void CSQCPlayer_SetCamera() } 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)); -- 2.39.2