From: FruitieX Date: Wed, 13 Apr 2011 10:37:05 +0000 (+0300) Subject: now it "works" again X-Git-Tag: xonotic-v0.5.0~290 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3430032767c64a139fdbbcaff640a3d0cd66cf20;p=xonotic%2Fxonotic-data.pk3dir.git now it "works" again --- diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index 6208ef12b..ca19bf702 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -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"); } diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index fc90898fa..131d0a69b 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -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