]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix a few FTEQCC compilation warnings (variable const isn't a thing)
authorMario <zacjardine@y7mail.com>
Tue, 18 Sep 2018 02:29:20 +0000 (12:29 +1000)
committerMario <zacjardine@y7mail.com>
Tue, 18 Sep 2018 02:29:20 +0000 (12:29 +1000)
qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc
qcsrc/common/gamemodes/sv_rules.qh
qcsrc/common/mutators/mutator/damagetext/sv_damagetext.qc
qcsrc/common/mutators/mutator/dynamic_handicap/sv_dynamic_handicap.qc
qcsrc/lib/csqcmodel/cl_player.qc

index ffbecf1b3df6abcb68c558b4e1c9336713225328..493320ccebc695ac5e9a3b9276f8166e6587e844 100644 (file)
@@ -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
 
index ca1b6f8e74649e80c2b1ebe8c180871c00cef75e..f8950684b4967eabaa9990de93a7e53746d8f0cc 100644 (file)
@@ -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);
index d9eacaae0c4e7a1cf2821d4574bb255a572c3bd5..0e0aa13fd0404412f13e612743d648bc1d436cca 100644 (file)
@@ -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 (
index d5d3ba40f8ee233127078a6e4ff735d855f9f05a..4cfc0dd23779d4f5babee08a864b2fcce14dfdcd 100644 (file)
@@ -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);
index f87f00033762b4fbe18f2d5305989941a191828b..268b591264208458dcada567c028fbdf102be052 100644 (file)
@@ -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));