xref: /original-bsd/games/trek/systemname.c (revision 083a59b6)
1 /*
2  * Copyright (c) 1980, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)systemname.c	8.1 (Berkeley) 05/31/93";
10 #endif /* not lint */
11 
12 # include	"trek.h"
13 
14 /*
15 **  RETRIEVE THE STARSYSTEM NAME
16 **
17 **	Very straightforward, this routine just gets the starsystem
18 **	name.  It returns zero if none in the specified quadrant
19 **	(which, by the way, is passed it).
20 **
21 **	This routine knows all about such things as distressed
22 **	starsystems, etc.
23 */
24 
25 char *systemname(q1)
26 struct quad	*q1;
27 {
28 	register struct quad	*q;
29 	register int		i;
30 
31 	q = q1;
32 
33 	i = q->qsystemname;
34 	if (i & Q_DISTRESSED)
35 		i = Event[i & Q_SYSTEM].systemname;
36 
37 	i &= Q_SYSTEM;
38 	if (i == 0)
39 		return (0);
40 	return (Systemname[i]);
41 }
42