]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
now it "works" again
authorFruitieX <fruitiex@gmail.com>
Wed, 13 Apr 2011 10:37:05 +0000 (13:37 +0300)
committerFruitieX <fruitiex@gmail.com>
Wed, 13 Apr 2011 10:37:05 +0000 (13:37 +0300)
qcsrc/client/shownames.qc
qcsrc/server/cl_player.qc

index 6208ef12ba84102f3ec363ab683e16d2d1de0f3a..ca19bf702611127a86aa5937e84e5b2b167cd3ea 100644 (file)
@@ -58,7 +58,7 @@ void Draw_ShowNames()
         namepos = myPos + eX * 2 * iconsize_y;
         namesize = eX * mySize_x - eX * 2 * iconsize_y + eY * mySize_y;
 
-        drawcolorcodedstring_aspect(namepos, GetPlayerName(self.the_entnum), namesize, a, DRAWFLAG_NORMAL);
+        drawcolorcodedstring_aspect(namepos, GetPlayerName(self.the_entnum-1), namesize, a, DRAWFLAG_NORMAL);
 
         /* Or maybe a health bar instead?
          *
@@ -72,11 +72,13 @@ void Draw_ShowNames()
             drawhealthbar(o, rot * 90 * DEG2RAD, self.health, SPRITE_SIZE * t, SPRITE_HOTSPOT * t, SPRITE_HEALTHBAR_WIDTH * t, SPRITE_HEALTHBAR_HEIGHT * t, SPRITE_HEALTHBAR_MARGIN * t, SPRITE_HEALTHBAR_BORDER * t, align, self.teamradar_color, a * SPRITE_HEALTHBAR_BORDERALPHA, self.teamradar_color, a * SPRITE_HEALTHBAR_HEALTHALPHA, DRAWFLAG_NORMAL);
         }
         */
+        print(vtos(o), "\n");
     }
 }
 
 void ShowNames_Think()
 {
-
-
+    self.draw2d = Draw_ShowNames;
+    self.nextthink = time;
+    print("think!\n");
 }
index fc90898fa89dc1da8737914f46c092f5e29bb5cb..131d0a69bfab04d63c40e6c0bd80f778a0561120 100644 (file)
@@ -735,9 +735,6 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
 // sendflags use: 1 = origin, 2 = health/armor, 0x80 = same team (includes health), 4 = entity out of range/culled
 float SendEntity_ShowNames(entity to, float sendflags)
 {
-    if(self.owner == to) // no need to spam own coordinates/health
-        return TRUE;
-
     WriteByte(MSG_ENTITY, ENT_CLIENT_SHOWNAMES);
     WriteByte(MSG_ENTITY, num_for_edict(self.owner));
 
@@ -779,10 +776,13 @@ void shownames_think()
 
 float shownames_customize()
 {
+    return TRUE;
     if(vlen(other.origin - self.origin) < autocvar_sv_shownames_cull_distance)
+    if(self.owner != other) // no need to spam own coordinates
+    if(self.owner.team == other.team || (self.owner.team != other.team && checkpvs(self.origin, other)))
         return TRUE;
-    else
-        return FALSE;
+
+    return FALSE;
 }
 
 .float muted; // to be used by prvm_edictset server playernumber muted 1