]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Lyberta/DynamicHandicap
authorLyberta <lyberta@lyberta.net>
Sun, 10 Sep 2017 23:39:30 +0000 (02:39 +0300)
committerLyberta <lyberta@lyberta.net>
Sun, 10 Sep 2017 23:39:30 +0000 (02:39 +0300)
.gitlab-ci.yml
qcsrc/client/main.qc
qcsrc/client/mapvoting.qc
qcsrc/common/t_items.qc
qcsrc/server/command/vote.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/scores.qc
qcsrc/server/teamplay.qc

index 596f61ad1dff4f98684a79992af9718aa69d7ebd..9305f527cd3abc9640d17bff880e021b854d7b17 100644 (file)
@@ -29,7 +29,7 @@ test_sv_game:
     - wget -O data/maps/stormkeep.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints
     - wget -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache
     - make
-    - EXPECT=0a08daa9132d147f533776deda07643e
+    - EXPECT=ed9be8d1b1a544f89bcdd7d36876fede
     - HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
       | tee /dev/stderr
       | grep '^:'
index 374096f241695ef23c56c59d55a72bec8cb434a1..609e03775ece1454ceaab0db07e21c7d50ad47f9 100644 (file)
@@ -435,11 +435,10 @@ NET_HANDLE(ENT_CLIENT_SCORES, bool isnew)
        //      RegisterPlayer(o);
        //playerchecker will do this for us later, if it has not already done so
 
-    int sf, lf;
-       sf = ReadShort();
-       lf = ReadShort();
+       int sf = ReadShort();
+       int lf = ReadShort();
        FOREACH(Scores, true, {
-        int p = 1 << (i % 16);
+               int p = 1 << (i % 16);
                if (sf & p)
                {
                        if (lf & p)
@@ -447,7 +446,7 @@ NET_HANDLE(ENT_CLIENT_SCORES, bool isnew)
                        else
                                o.(scores(it)) = ReadChar();
                }
-    });
+       });
 
        return = true;
 
@@ -461,24 +460,21 @@ NET_HANDLE(ENT_CLIENT_TEAMSCORES, bool isnew)
 {
        make_pure(this);
        int i;
-       entity o;
 
        this.team = ReadByte();
-       o = this.owner = GetTeam(this.team, true); // these team numbers can always be trusted
+       entity o = this.owner = GetTeam(this.team, true); // these team numbers can always be trusted
 
-    int sf, lf;
 #if MAX_TEAMSCORE <= 8
-       sf = ReadByte();
-       lf = ReadByte();
+       int sf = ReadByte();
+       int lf = ReadByte();
 #else
-       sf = ReadShort();
-       lf = ReadShort();
+       int sf = ReadShort();
+       int lf = ReadShort();
 #endif
-       int p;
-       for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
-               if(sf & p)
+       for(i = 0; i < MAX_TEAMSCORE; ++i)
+               if(sf & BIT(i))
                {
-                       if(lf & p)
+                       if(lf & BIT(i))
                                o.(teamscores(i)) = ReadInt24_t();
                        else
                                o.(teamscores(i)) = ReadChar();
@@ -494,7 +490,7 @@ NET_HANDLE(ENT_CLIENT_CLIENTDATA, bool isnew)
        make_pure(this);
        float newspectatee_status;
 
-    int f = ReadByte();
+       int f = ReadByte();
 
        scoreboard_showscores_force = (f & BIT(0));
 
@@ -551,9 +547,9 @@ NET_HANDLE(ENT_CLIENT_CLIENTDATA, bool isnew)
 NET_HANDLE(ENT_CLIENT_NAGGER, bool isnew)
 {
        make_pure(this);
-    int i, j, b, f;
+       int i, j, b, f;
 
-    int nags = ReadByte(); // NAGS NAGS NAGS NAGS NAGS NAGS NADZ NAGS NAGS NAGS
+       int nags = ReadByte(); // NAGS NAGS NAGS NAGS NAGS NAGS NADZ NAGS NAGS NAGS
 
        if(!(nags & BIT(2)))
        {
@@ -590,7 +586,7 @@ NET_HANDLE(ENT_CLIENT_NAGGER, bool isnew)
                for(i = 1; i <= maxclients; i += 8)
                {
                        f = ReadByte();
-                       for(j = i-1, b = 1; b < 256; b *= 2, ++j)
+                       for(j = i-1, b = BIT(0); b < BIT(8); b <<= 1, ++j)
                                if (!(f & b))
                                        if(playerslots[j])
                                                playerslots[j].ready = 0;
@@ -609,23 +605,24 @@ NET_HANDLE(ENT_CLIENT_NAGGER, bool isnew)
 NET_HANDLE(ENT_CLIENT_ELIMINATEDPLAYERS, bool isnew)
 {
        make_pure(this);
-    int sf; serialize(byte, 0, sf);
+       int sf = 0;
+       serialize(byte, 0, sf);
        if (sf & 1) {
                for (int j = 0; j < maxclients; ++j) {
                        if (playerslots[j]) {
-                           playerslots[j].eliminated = 1;
+                               playerslots[j].eliminated = 1;
                        }
-        }
+               }
                for (int i = 1; i <= maxclients; i += 8) {
                        int f = 0;
                        serialize(byte, 0, f);
                        for (int b = 0; b < 8; ++b) {
                                if (f & BIT(b)) continue;
-                int j = i - 1 + b;
-                if (playerslots[j]) {
-                    playerslots[j].eliminated = 0;
-                }
-            }
+                               int j = i - 1 + b;
+                               if (playerslots[j]) {
+                                       playerslots[j].eliminated = 0;
+                               }
+                       }
                }
        }
        return true;
@@ -643,7 +640,7 @@ NET_HANDLE(ENT_CLIENT_RANDOMSEED, bool isnew)
 NET_HANDLE(ENT_CLIENT_ACCURACY, bool isnew)
 {
        make_pure(this);
-    int sf = ReadInt24_t();
+       int sf = ReadInt24_t();
        if (sf == 0) {
                for (int w = 0; w <= WEP_LAST - WEP_FIRST; ++w)
                        weapon_accuracy[w] = -1;
@@ -653,7 +650,7 @@ NET_HANDLE(ENT_CLIENT_ACCURACY, bool isnew)
        int f = 1;
        for (int w = 0; w <= WEP_LAST - WEP_FIRST; ++w) {
                if (sf & f) {
-            int b = ReadByte();
+                       int b = ReadByte();
                        if (b == 0)
                                weapon_accuracy[w] = -1;
                        else if (b == 255)
index b34bd0f3a1476b9fda20e2da89b0c7249c648a03..87b6d585b38c769cd8d20d65d0be24ad3303d52d 100644 (file)
@@ -563,7 +563,7 @@ void MapVote_ReadMask()
        int i;
        if ( mv_num_maps < 24 )
        {
-               int mask, power;
+               int mask;
                if(mv_num_maps < 8)
                        mask = ReadByte();
                else if(mv_num_maps < 16)
@@ -571,9 +571,9 @@ void MapVote_ReadMask()
                else
                        mask = ReadLong();
 
-               for(i = 0, power = 1; i < mv_num_maps; ++i, power *= 2)
+               for(i = 0; i < mv_num_maps; ++i)
                {
-                       if ( mask & power )
+                       if (mask & BIT(i))
                                mv_flags[i] |= GTV_AVAILABLE;
                        else
                                mv_flags[i] &= ~GTV_AVAILABLE;
index 4fc2e38219c144e2a5801129419847e2444c4808..c116b440c42a4686ff8b034f0e3b800e2092c8fd 100644 (file)
@@ -901,6 +901,7 @@ LABEL(pickup)
                                if(it.itemdef) // is a registered item
                                {
                                        Item_Show(it, -1);
+                                       it.scheduledrespawntime = 0;
                                        RandomSelection_AddEnt(it, it.cnt, 0);
                                }
                        });
index 8cfed5bae4bb06e1c15e15ead247605aaa08481f..1a786cc7fe7891631c567af18cc817345105853c 100644 (file)
@@ -81,8 +81,9 @@ bool Nagger_SendEntity(entity this, entity to, float sendflags)
        {
                for (i = 1; i <= maxclients; i += 8)
                {
-                       for (f = 0, e = edict_num(i), b = 1; b < 256; b *= 2, e = nextent(e))
-                               if (!IS_REAL_CLIENT(e) || e.ready) f |= b;
+                       for (f = 0, e = edict_num(i), b = BIT(0); b < BIT(8); b <<= 1, e = nextent(e))
+                               if (!IS_REAL_CLIENT(e) || e.ready)
+                                       f |= b;
                        WriteByte(MSG_ENTITY, f);
                }
        }
index 1b631c4b77668f3533b7f88b94c434d3999d825f..554da5f804bbaa2b35a633053b5c3a9c1bd55fa3 100644 (file)
@@ -938,8 +938,8 @@ bool EliminatedPlayers_SendEntity(entity this, entity to, float sendflags)
        serialize(byte, out, sendflags);
        if (sendflags & 1) {
                for (int i = 1; i <= maxclients; i += 8) {
-                   int f = 0;
-            entity e = edict_num(i);
+                       int f = 0;
+                       entity e = edict_num(i);
                        for (int b = 0; b < 8; ++b, e = nextent(e)) {
                                if (eliminatedPlayers.isEliminated(e)) {
                                        f |= BIT(b);
index 266f7734b660bae45bad90f29514a869ef182b46..11bc60238252bb071cbade6518384a3ac8cbb47c 100644 (file)
@@ -54,7 +54,7 @@ vector ScoreField_Compare(entity t1, entity t2, .float field, float fieldflags,
 
 bool TeamScore_SendEntity(entity this, entity to, float sendflags)
 {
-       float i, p, longflags;
+       float i, longflags;
 
        WriteHeader(MSG_ENTITY, ENT_CLIENT_TEAMSCORES);
        int t = this.team - 1;
@@ -62,9 +62,9 @@ bool TeamScore_SendEntity(entity this, entity to, float sendflags)
        WriteByte(MSG_ENTITY, t);
 
        longflags = 0;
-       for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
+       for(i = 0; i < MAX_TEAMSCORE; ++i)
                if(this.(teamscores(i)) > 127 || this.(teamscores(i)) <= -128)
-                       longflags |= p;
+                       longflags |= BIT(i);
 
 #if MAX_TEAMSCORE <= 8
        WriteByte(MSG_ENTITY, sendflags);
@@ -73,10 +73,10 @@ bool TeamScore_SendEntity(entity this, entity to, float sendflags)
        WriteShort(MSG_ENTITY, sendflags);
        WriteShort(MSG_ENTITY, longflags);
 #endif
-       for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
-               if(sendflags & p)
+       for(i = 0; i < MAX_TEAMSCORE; ++i)
+               if(sendflags & BIT(i))
                {
-                       if(longflags & p)
+                       if(longflags & BIT(i))
                                WriteInt24_t(MSG_ENTITY, this.(teamscores(i)));
                        else
                                WriteChar(MSG_ENTITY, this.(teamscores(i)));
index 24e9a5221e1e62ac7ebb30e4d3bc52f8760f54a5..12aca2133a0f67aa48a09d9bd9e8a07eee5f73e2 100644 (file)
@@ -47,7 +47,7 @@ void InitGameplayMode()
        int done = 0; for (int i = 0, n = numentityfields(); i < n; ++i) {
            string k = entityfieldname(i); vector v = (k == "mins") ? mi_min : (k == "maxs") ? mi_max : '0 0 0';
            if (v) {
-            putentityfieldstring(i, world, sprintf("%d %d %d", v));
+            putentityfieldstring(i, world, sprintf("%v", v));
             if (++done == 2) break;
         }
        }