]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/client.qc
Don't attempt to network more than the maximum number of shown spectators, fixes...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / client.qc
index 245ada1e1a4a521d0b526e95bb1c241197333c35..99aa86d24f82d7d233fc12f6fff56e2661252376 100644 (file)
@@ -1,6 +1,7 @@
 #include "client.qh"
 
-#include <server/defs.qh>
+#include <common/weapons/_all.qh>
+#include <common/stats.qh>
 #include <server/miscfunctions.qh>
 #include <common/effects/all.qh>
 #include "anticheat.qh"
@@ -49,6 +50,7 @@
 #include "../common/vehicles/all.qh"
 
 #include "weapons/hitplot.qh"
+#include "weapons/selection.qh"
 #include "weapons/weaponsystem.qh"
 
 #include "../common/net_notice.qh"
@@ -59,6 +61,8 @@
 
 #include "../common/items/_mod.qh"
 
+#include <common/gamemodes/gamemode/nexball/sv_nexball.qh>
+
 #include "../common/mutators/mutator/waypoints/all.qh"
 #include "../common/mutators/mutator/instagib/sv_instagib.qh"
 #include <common/gamemodes/_mod.qh>
@@ -77,6 +81,8 @@
 
 #include <common/mutators/mutator/overkill/oknex.qh>
 
+#include <common/weapons/weapon/vortex.qh>
+
 STATIC_METHOD(Client, Add, void(Client this, int _team))
 {
     ClientConnect(this);
@@ -115,9 +121,13 @@ void WriteSpectators(entity player, entity to)
 {
        if(!player) { return; } // not sure how, but best to be safe
 
+       int spec_count = 0;
        FOREACH_CLIENT(IS_REAL_CLIENT(it) && IS_SPEC(it) && it != to && it.enemy == player,
        {
+               if(spec_count >= MAX_SPECTATORS)
+                       break;
                WriteByte(MSG_ENTITY, num_for_edict(it));
+               ++spec_count;
        });
 }
 
@@ -335,7 +345,6 @@ void PutObserverInServer(entity this)
        this.alpha = 0;
        this.scale = 0;
        this.fade_time = 0;
-       this.pain_frame = 0;
        this.pain_finished = 0;
        STAT(STRENGTH_FINISHED, this) = 0;
        STAT(INVINCIBLE_FINISHED, this) = 0;
@@ -618,7 +627,6 @@ void PutPlayerInServer(entity this)
        bool q3dfcompat = autocvar_sv_q3defragcompat && autocvar_sv_q3defragcompat_changehitbox;
        this.scale = ((q3dfcompat) ? 0.9 : autocvar_sv_player_scale);
        this.fade_time = 0;
-       this.pain_frame = 0;
        this.pain_finished = 0;
        this.pushltime = 0;
        setthink(this, func_null); // players have no think function