]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
some debug prints, distance culling (cvarred)
authorFruitieX <fruitiex@gmail.com>
Mon, 11 Apr 2011 19:46:59 +0000 (22:46 +0300)
committerFruitieX <fruitiex@gmail.com>
Mon, 11 Apr 2011 19:46:59 +0000 (22:46 +0300)
defaultXonotic.cfg
qcsrc/client/Main.qc
qcsrc/server/autocvars.qh
qcsrc/server/cl_player.qc

index ffd3148250e96f37b2b8f08879aef1f042c314bf..c7cd0d032a88ea6a664a4ca983a60d9b9bc4491f 100644 (file)
@@ -402,6 +402,8 @@ net_connecttimeout 30
 sv_jumpstep 1 // step up stairs while jumping, makes it easier to reach ledges
 set ekg 0      "Throw huge amounts of gibs"
 
+sv_shownames_cull_distance 1000 "distance after which to not send origin/health/armor of another player"
+
 cl_movement 1
 cl_movement_track_canjump 0
 cl_stairsmoothspeed 200
index 144e1f79f41e3fcac5a6e92a33db5cb66710f044..87b3997e65f1b0e69f2ea1bf6180c8a627da3b15 100644 (file)
@@ -914,6 +914,7 @@ void Ent_ShowNames()
 
     sf = ReadByte();
     the_entnum = ReadByte();
+    print("sendflags: ", ftos(sf), "\n");
 
     if(sf & 1)
     {
@@ -921,12 +922,12 @@ void Ent_ShowNames()
         playerslots[the_entnum].origin_y = ReadShort();
         playerslots[the_entnum].origin_z = ReadShort();
         print("Updated origin = ", vtos(playerslots[the_entnum].origin), " for player ", GetPlayerName(the_entnum-1), "\n");
+        print("Their health/armor = ", playerslots[the_entnum].health, "/", playerslots[the_entnum].armorvalue, "\n");
     }
     if(sf & 2)
     {
         playerslots[the_entnum].health = ReadByte();
         playerslots[the_entnum].armorvalue = ReadByte();
-        print("Updated health/armor = ", ftos(playerslots[the_entnum].health), "/", ftos(playerslots[the_entnum].health), "\n");
     }
 
     /*
index d5652b775e4620b3831c96b0ae44d16ba1f737b8..485d2b10305e96eacd4418444c524cf66ce1af54 100644 (file)
@@ -1232,3 +1232,4 @@ float autocvar_waypoint_benchmark;
 float autocvar_welcome_message_time;
 float autocvar_sv_gameplayfix_gravityunaffectedbyticrate;
 float autocvar_g_trueaim_minrange;
+float autocvar_sv_shownames_cull_distance;
index 85e557c96314268c48705e3edc9c6a906c0174b6..4de460f85a79d0cffdefb9987cc100bb22f99c2d 100644 (file)
@@ -736,6 +736,9 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
 // sendflags use: 1 = origin, 2 = health/armor, 0x80 = same team (includes health)
 float SendEntity_ShowNames(entity to, float sendflags)
 {
+    if(vlen(to.origin - self.origin) < autocvar_sv_shownames_cull_distance) // distance cull
+        return;
+
     WriteByte(MSG_ENTITY, ENT_CLIENT_SHOWNAMES);
     //sendflags &= 127;
     if(teams_matter && self.team == to.team)