]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Mario/tweaks
authorMario <mario@smbclan.net>
Sat, 25 Jun 2016 20:29:53 +0000 (06:29 +1000)
committerMario <mario@smbclan.net>
Sat, 25 Jun 2016 20:29:53 +0000 (06:29 +1000)
1  2 
qcsrc/server/cl_client.qc

index d50b89920c4b9c64c9e6360ae0797f7bf9f929f9,733b0935571b9f8b75d33fea219e04fba7c3a074..b10ea960c5b16d6ed9370d3e84413cc14b586903
@@@ -802,7 -802,7 +802,7 @@@ void ClientKill_Now(entity this
        if(this.killindicator_teamchange)
                ClientKill_Now_TeamChange(this);
  
 -      if(IS_PLAYER(this))
 +      if(!IS_SPEC(this) && !IS_OBSERVER(this))
                Damage(this, this, this, 100000, DEATH_KILL.m_id, this.origin, '0 0 0');
  
        // now I am sure the player IS dead
@@@ -905,7 -905,7 +905,7 @@@ void ClientKill_TeamChange (entity this
                                setorigin(it.killindicator, '0 0 52');
                                setthink(it.killindicator, KillIndicator_Think);
                                it.killindicator.nextthink = starttime + (it.lip) * 0.05;
 -                              clientkilltime = max(clientkilltime, it.killindicator.nextthink + 0.05);
 +                              //clientkilltime = max(clientkilltime, it.killindicator.nextthink + 0.05);
                                it.killindicator.cnt = ceil(killtime);
                        });
                        this.lip = 0;
@@@ -1704,14 -1704,14 +1704,14 @@@ bool Spectate(entity this, entity pl
  
  bool SpectateNext(entity this)
  {
-       other = find(this.enemy, classname, STR_PLAYER);
+       entity ent = find(this.enemy, classname, STR_PLAYER);
  
-       if (MUTATOR_CALLHOOK(SpectateNext, this, other))
-               other = M_ARGV(1, entity);
-       else if (!other)
-               other = find(other, classname, STR_PLAYER);
+       if (MUTATOR_CALLHOOK(SpectateNext, this, ent))
+               ent = M_ARGV(1, entity);
+       else if (!ent)
+               ent = find(ent, classname, STR_PLAYER);
  
-       if(other) { SetSpectatee(this, other); }
+       if(ent) { SetSpectatee(this, ent); }
  
        return SpectateSet(this);
  }
  bool SpectatePrev(entity this)
  {
        // NOTE: chain order is from the highest to the lower entnum (unlike find)
-       other = findchain(classname, STR_PLAYER);
-       if (!other) // no player
+       entity ent = findchain(classname, STR_PLAYER);
+       if (!ent) // no player
                return false;
  
-       entity first = other;
+       entity first = ent;
        // skip players until current spectated player
        if(this.enemy)
-       while(other && other != this.enemy)
-               other = other.chain;
+       while(ent && ent != this.enemy)
+               ent = ent.chain;
  
-       switch (MUTATOR_CALLHOOK(SpectatePrev, this, other, first))
+       switch (MUTATOR_CALLHOOK(SpectatePrev, this, ent, first))
        {
                case MUT_SPECPREV_FOUND:
-                   other = M_ARGV(1, entity);
+                   ent = M_ARGV(1, entity);
                    break;
                case MUT_SPECPREV_RETURN:
-                   other = M_ARGV(1, entity);
+                   ent = M_ARGV(1, entity);
                    return true;
                case MUT_SPECPREV_CONTINUE:
                default:
                {
-                       if(other.chain)
-                               other = other.chain;
+                       if(ent.chain)
+                               ent = ent.chain;
                        else
-                               other = first;
+                               ent = first;
                        break;
                }
        }
  
-       SetSpectatee(this, other);
+       SetSpectatee(this, ent);
        return SpectateSet(this);
  }
  
@@@ -2420,7 -2420,18 +2420,18 @@@ void PlayerPostThink (entity this
        if (IS_REAL_CLIENT(this))
        if (IS_PLAYER(this) || sv_maxidle_spectatorsareidle)
        {
-               if (time - this.parm_idlesince < 1) // instead of (time == this.parm_idlesince) to support sv_maxidle <= 10
+               int totalClients = 0;
+               if(sv_maxidle_slots > 0)
+               {
+                       FOREACH_CLIENT(IS_REAL_CLIENT(it) || sv_maxidle_slots_countbots,
+                       {
+                               ++totalClients;
+                       });
+               }
+               if (sv_maxidle_slots > 0 && (maxclients - totalClients) > sv_maxidle_slots)
+               { /* do nothing */ }
+               else if (time - this.parm_idlesince < 1) // instead of (time == this.parm_idlesince) to support sv_maxidle <= 10
                {
                        if (this.idlekick_lasttimeleft)
                        {