// RADAR (experimental)
Com_sprintf (entry, sizeof(entry), "xl %i yv %i picn radar ", 4, -200);
j = strlen(entry);
stringlength = strlen(string);
if (!(stringlength + j > 1024))
strcpy (string + stringlength, entry);
// Rroff showing monsters on the radar will probably be too much of a performance consideration
// so this is just experimental/testing code - we might also overflow the string limit for sending hud stuff
cl_ent = &g_edicts[0];
for (i=0 ; i<globals.num_edicts ; i++, cl_ent++)
{
if (!(cl_ent->svflags & SVF_MONSTER))
continue;
if (cl_ent->monsterinfo.aiflags & AI_GOOD_GUY)
continue;
if (cl_ent->svflags & SVF_NOCLIENT)
continue;
if (cl_ent->health <=0)
continue;
if (level.time > (cl_ent->monsterinfo.attack_finished+1))
continue;
x1 = (cl_ent->s.origin[0]-ent->s.origin[0]);
y1 = (cl_ent->s.origin[1]-ent->s.origin[1]);
dist = sqrt((x1*x1) + (y1*y1));
if (dist>1984)
{
dist = 1984;
}
angle = ent->s.angles[YAW];
angle=360-angle; // reflect coord system
angle+=90; // adjust for clockwise offset
angle = angle/360;
angle-=(int)angle;
angle*= 360;
angle2 = atan2(y1, x1) * 180 / M_PI;
if (angle2<0)
angle2+=360;
angle2=360-angle2; // reflect coord system
angle2-=angle;
if (angle2<0)
angle2+=360;
angle2+=90; // adjust for clockwise offset
angle2 = angle2/360;
angle2-=(int)angle2;
angle2*= 360;
angle2*= (M_PI / 180);
dist=dist/4096*128;
x1=x1/4096*128;
y1=y1/4096*128;
x1=sin(angle2)*dist;
y1=cos(angle2)*dist;
x = 69+x1;
y = -137-y1;
Com_sprintf (entry, sizeof(entry), "xl %i yv %i picn rpoint ", x-4, y-4);
j = strlen(entry);
stringlength = strlen(string);
if (!(stringlength + j > 1024))
strcpy (string + stringlength, entry);
}