cl_radar 2, map overview player visibility improvements
This commit is contained in:
parent
ca3cdb3a28
commit
7e46202f7b
5 changed files with 35 additions and 7 deletions
|
@ -119,7 +119,7 @@ void Overview_DrawLayer( void ) {
|
|||
R_PolygonVertex( [ ovMap.vVert2[0], ovMap.vVert2[1], ovMap.fHeight ], '0 1', '1 1 1', 1.0f ); // Bottom left
|
||||
R_EndPolygon();
|
||||
}
|
||||
|
||||
|
||||
for ( entity eFind = world; ( eFind = find( eFind, classname, "player" ) ); ) {
|
||||
if ( getplayerkeyvalue( eFind.entnum - 1, "*team" ) == "1" ) {
|
||||
R_BeginPolygon( "sprites/iplayerred.spr_0.tga" );
|
||||
|
@ -130,10 +130,12 @@ void Overview_DrawLayer( void ) {
|
|||
R_BeginPolygon( "sprites/iplayerblue.spr_0.tga" );
|
||||
}
|
||||
}
|
||||
R_PolygonVertex( [ eFind.absmax[0] + 16, eFind.absmin[1] - 16, ovMap.fHeight + 16 ], '1 0', '1 1 1', 1.0f ); // Top Right
|
||||
R_PolygonVertex( [ eFind.absmin[0] - 16, eFind.absmin[1] - 16, ovMap.fHeight + 16 ], '0 0', '1 1 1', 1.0f ); // Top left
|
||||
R_PolygonVertex( [ eFind.absmin[0] - 16, eFind.absmax[1] + 16, ovMap.fHeight + 16 ], '0 1', '1 1 1', 1.0f ); // Bottom left
|
||||
R_PolygonVertex( [ eFind.absmax[0] + 16, eFind.absmax[1] + 16, ovMap.fHeight + 16 ], '1 1', '1 1 1', 1.0f ); // Bottom right
|
||||
float psize;
|
||||
psize = Math_Lerp(64, 16, pSeat.fMapLerp);
|
||||
R_PolygonVertex( [ eFind.absmax[0] + psize, eFind.absmin[1] - psize, ovMap.fHeight + 16 ], '1 0', '1 1 1', 1.0f ); // Top Right
|
||||
R_PolygonVertex( [ eFind.absmin[0] - psize, eFind.absmin[1] - psize, ovMap.fHeight + 16 ], '0 0', '1 1 1', 1.0f ); // Top left
|
||||
R_PolygonVertex( [ eFind.absmin[0] - psize, eFind.absmax[1] + psize, ovMap.fHeight + 16 ], '0 1', '1 1 1', 1.0f ); // Bottom left
|
||||
R_PolygonVertex( [ eFind.absmax[0] + psize, eFind.absmax[1] + psize, ovMap.fHeight + 16 ], '1 1', '1 1 1', 1.0f ); // Bottom right
|
||||
R_EndPolygon();
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ void Player_ReadEntity(float flIsNew)
|
|||
pl.velocity[2] = readcoord();
|
||||
pl.flags = readfloat();
|
||||
pl.pmove_flags = readfloat();
|
||||
pl.weapon = readbyte();
|
||||
pl.activeweapon = readbyte();
|
||||
pl.health = readbyte();
|
||||
pl.movetype = readfloat();
|
||||
pl.view_ofs[2] = readfloat();
|
||||
|
|
|
@ -88,7 +88,7 @@ void player::draw(void)
|
|||
if (this.lastweapon != this.activeweapon) {
|
||||
if (this.activeweapon) {
|
||||
#ifdef CSTRIKE
|
||||
setmodel(this.p_model, sPModels[this.weapon - 1]);
|
||||
setmodel(this.p_model, sPModels[this.activeweapon - 1]);
|
||||
#endif
|
||||
} else {
|
||||
setmodel(this.p_model, "");
|
||||
|
|
|
@ -136,6 +136,7 @@ void Game_PutClientInServer(void)
|
|||
self.vPain = Player_Pain;
|
||||
self.vDeath = Player_Death;
|
||||
self.iBleeds = TRUE;
|
||||
self.pvsflags = PVSF_IGNOREPVS;
|
||||
self.fSlotGrenade = 0;
|
||||
self.viewzoom = 1.0;
|
||||
setmodel(self, "models/player/vip/vip.mdl");
|
||||
|
|
|
@ -21,10 +21,35 @@ Player_SendEntity
|
|||
*/
|
||||
float Player_SendEntity(entity ePEnt, float fChanged)
|
||||
{
|
||||
/* If dead */
|
||||
if (self.health <= 0 && ePEnt != self) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Fix CT/VIP team */
|
||||
float t1, t2;
|
||||
t1 = ePEnt.team;
|
||||
t2 = self.team;
|
||||
if (t1 == TEAM_VIP) {
|
||||
t1 = TEAM_CT;
|
||||
} else if (t2 == TEAM_VIP) {
|
||||
t2 = TEAM_CT;
|
||||
}
|
||||
|
||||
/* Always make team-mates visible */
|
||||
if (t1 != t2 && ePEnt.health > 0) {
|
||||
/* Can we even see them? */
|
||||
if (!checkpvs(ePEnt.origin, self)) {
|
||||
return FALSE;
|
||||
} else {
|
||||
/* We're in the same PVS, but we might still not be able to see them */
|
||||
traceline(self.origin, ePEnt.origin, FALSE, self);
|
||||
if (trace_ent != ePEnt) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WriteByte(MSG_ENTITY, ENT_PLAYER);
|
||||
WriteShort(MSG_ENTITY, self.modelindex);
|
||||
WriteCoord(MSG_ENTITY, self.origin[0]);
|
||||
|
|
Loading…
Reference in a new issue